mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-11 03:52:56 +00:00
Resolve Docker lint (hadolint) errors
- Exclude `ppc64` Dockerfiles from the linting in pre-commit since we cannot check their build easily and so fix the lint errors without breaking something (already excluded in the `Makefile`) - Fix examples Dockerfile to invert root and jovyan user instructions (Last user should not be root `DL3002`)
This commit is contained in:
@@ -21,6 +21,8 @@ repos:
|
|||||||
name: Hadolint linter
|
name: Hadolint linter
|
||||||
description: Runs Hadolint to check for Dockerfile best practices
|
description: Runs Hadolint to check for Dockerfile best practices
|
||||||
language: system
|
language: system
|
||||||
|
# Exclude ppc64le Dockerfile since cannot check their build easily
|
||||||
|
exclude: ppc64
|
||||||
types:
|
types:
|
||||||
- dockerfile
|
- dockerfile
|
||||||
entry: hadolint
|
entry: hadolint
|
||||||
|
@@ -4,12 +4,13 @@
|
|||||||
# Pick your favorite docker-stacks image
|
# Pick your favorite docker-stacks image
|
||||||
FROM jupyter/minimal-notebook:55d5ca6be183
|
FROM jupyter/minimal-notebook:55d5ca6be183
|
||||||
|
|
||||||
USER jovyan
|
|
||||||
|
|
||||||
# Add permanent pip/conda installs, data files, other user libs here
|
|
||||||
# e.g., RUN pip install jupyter_dashboards
|
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
# Add permanent apt-get installs and other root commands here
|
# Add permanent apt-get installs and other root commands here
|
||||||
# e.g., RUN apt-get install npm nodejs
|
# e.g., RUN apt-get install npm nodejs
|
||||||
|
|
||||||
|
USER $NB_UID
|
||||||
|
|
||||||
|
# Switch back to jovyan to avoid accidental container runs as root
|
||||||
|
# Add permanent pip/conda installs, data files, other user libs here
|
||||||
|
# e.g., RUN pip install jupyter_dashboards
|
||||||
|
@@ -4,12 +4,13 @@
|
|||||||
# Pick your favorite docker-stacks image
|
# Pick your favorite docker-stacks image
|
||||||
FROM jupyter/minimal-notebook:2d125a7161b5
|
FROM jupyter/minimal-notebook:2d125a7161b5
|
||||||
|
|
||||||
USER jovyan
|
|
||||||
|
|
||||||
# Add permanent pip/conda installs, data files, other user libs here
|
|
||||||
# e.g., RUN pip install jupyter_dashboards
|
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
# Add permanent apt-get installs and other root commands here
|
# Add permanent apt-get installs and other root commands here
|
||||||
# e.g., RUN apt-get install npm nodejs
|
# e.g., RUN apt-get install npm nodejs
|
||||||
|
|
||||||
|
USER $NB_UID
|
||||||
|
|
||||||
|
# Switch back to jovyan to avoid accidental container runs as root
|
||||||
|
# Add permanent pip/conda installs, data files, other user libs here
|
||||||
|
# e.g., RUN pip install jupyter_dashboards
|
||||||
|
Reference in New Issue
Block a user