File tree Expand file tree Collapse file tree 11 files changed +65
-18
lines changed Expand file tree Collapse file tree 11 files changed +65
-18
lines changed Original file line number Diff line number Diff line change 40
40
echo "There were errors in some of the checked files. Please run `json_verify` on such files and fix issues there."
41
41
fi
42
42
exit "${ret_code}"
43
+
44
+ - name : Validate Dockerfiles
45
+ id : validate-dockerfiles
46
+ run : |
47
+ type hadolint || sudo apt-get -y install wget \
48
+ && wget --output-document=hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 \
49
+ && chmod a+x hadolint
50
+ echo "Starting Hadolint"
51
+ find . -name "Dockerfile" | xargs ./hadolint --config ./ci/hadolint-config.yaml
52
+ echo "Hadolint done"
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ ENV BASH_ENV="source /opt/anaconda3/bin/activate ${APP_ROOT}" \
79
79
USER 1001
80
80
81
81
# Set the default CMD to print the usage of the language image.
82
- CMD $STI_SCRIPTS_PATH/usage
82
+ CMD [ " $STI_SCRIPTS_PATH/usage" ]
83
83
84
84
85
85
FROM s2i-python-anaconda-38-base
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ LABEL name="odh-notebook-base-centos-stream9-python-3.9" \
13
13
WORKDIR /opt/app-root/bin
14
14
15
15
# Install micropipenv to deploy packages from Pipfile.lock
16
- RUN pip install -U "micropipenv[toml]"
16
+ RUN pip install --no-cache-dir - U "micropipenv[toml]"
17
17
18
18
# Install Python dependencies from Pipfile.lock file
19
19
COPY Pipfile.lock ./
@@ -22,7 +22,7 @@ COPY Pipfile.lock ./
22
22
USER root
23
23
24
24
# Install usefull OS packages
25
- RUN dnf install -y mesa-libGL
25
+ RUN dnf install -y mesa-libGL && dnf clean all && rm -rf /var/cache/yum
26
26
27
27
# Other apps and tools installed as default user
28
28
USER 1001
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ LABEL name="odh-notebook-base-ubi8-python-3.8" \
13
13
WORKDIR /opt/app-root/bin
14
14
15
15
# Install micropipenv to deploy packages from Pipfile.lock
16
- RUN pip install -U "micropipenv[toml]"
16
+ RUN pip install --no-cache-dir - U "micropipenv[toml]"
17
17
18
18
# Install Python dependencies from Pipfile.lock file
19
19
COPY Pipfile.lock ./
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ LABEL name="odh-notebook-base-ubi9-python-3.9" \
13
13
WORKDIR /opt/app-root/bin
14
14
15
15
# Install micropipenv to deploy packages from Pipfile.lock
16
- RUN pip install -U "micropipenv[toml]"
16
+ RUN pip install --no-cache-dir - U "micropipenv[toml]"
17
17
18
18
# Install Python dependencies from Pipfile.lock file
19
19
COPY Pipfile.lock ./
@@ -24,7 +24,7 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P
24
24
USER root
25
25
26
26
# Install usefull OS packages
27
- RUN dnf install -y mesa-libGL
27
+ RUN dnf install -y mesa-libGL && dnf clean all && rm -rf /var/cache/yum
28
28
29
29
# Other apps and tools installed as default user
30
30
USER 1001
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ # Reference https://github.com/hadolint/hadolint
4
+ # hadolint --config ./ci/hadolint-config.yaml <Dockerfile>
5
+
6
+ # We should revisit this ignore list and reduce it regularly
7
+
8
+ ignored :
9
+ # DL3006 warning: Always tag the version of an image explicitly
10
+ - DL3006
11
+ # DL3033 warning: Specify version with `yum install -y <package>-<version>`.
12
+ - DL3033
13
+ # DL3045 warning: `COPY` to a relative destination without `WORKDIR` set.
14
+ - DL3045
15
+ # DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
16
+ - DL3041
17
+ # DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
18
+ - DL3059
19
+ # DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use
20
+ # `pip install <package>==<version>` or `pip install --requirement <requirements file>`
21
+ - DL3013
22
+ # DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it.
23
+ # If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox
24
+ # then consider explicitly setting your SHELL to /bin/ash, or disable this check
25
+ - DL4006
26
+ # DL3007 warning: Using latest is prone to errors if the image will ever update.
27
+ # Pin the version explicitly to a release tag
28
+ - DL3007
29
+ # SC3060 warning: In POSIX sh, string replacement is undefined.
30
+ - SC3060
31
+ # SC2086 info: Double quote to prevent globbing and word splitting.
32
+ - SC2086
33
+ # SC2046 warning: Quote this to prevent word splitting.
34
+ - SC2046
35
+ # SC2140 warning: Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
36
+ - SC2140
Original file line number Diff line number Diff line change @@ -87,4 +87,4 @@ WORKDIR /opt/app-root/src
87
87
88
88
USER 1001
89
89
90
- CMD /opt/app-root/bin/run-code-server.sh
90
+ CMD [ " /opt/app-root/bin/run-code-server.sh" ]
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ RUN echo "Installing softwares and packages" && \
29
29
fix-permissions /opt/app-root -P
30
30
31
31
# Install usefull OS packages
32
- RUN dnf install -y jq git-lfs libsndfile
32
+ RUN dnf install -y jq git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum
33
33
34
34
# Install code-server
35
35
RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \
@@ -105,4 +105,4 @@ WORKDIR /opt/app-root/src
105
105
106
106
USER 1001
107
107
108
- CMD /opt/app-root/bin/run-code-server.sh
108
+ CMD [ " /opt/app-root/bin/run-code-server.sh" ]
Original file line number Diff line number Diff line change @@ -28,20 +28,20 @@ COPY utils ./utils/
28
28
USER root
29
29
30
30
# Install usefull OS packages
31
- RUN dnf install -y jq unixODBC git-lfs libsndfile
31
+ RUN dnf install -y jq unixODBC git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum
32
32
33
33
# Disable announcement plugin of jupyterlab
34
34
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
35
35
36
36
# Install MongoDB Client, We need a special repo for MongoDB as they do their own distribution
37
37
COPY mongodb-org-6.0.repo-x86_64 /etc/yum.repos.d/mongodb-org-6.0.repo
38
38
39
- RUN dnf install -y mongocli
39
+ RUN dnf install -y mongocli && dnf clean all && rm -rf /var/cache/yum
40
40
41
41
# Install MSSQL Client, We need a special repo for MSSQL as they do their own distribution
42
42
COPY mssql-2022.repo-x86_64 /etc/yum.repos.d/mssql-2022.repo
43
43
44
- RUN ACCEPT_EULA=Y dnf install -y mssql-tools18 unixODBC-devel
44
+ RUN ACCEPT_EULA=Y dnf install -y mssql-tools18 unixODBC-devel && dnf clean all && rm -rf /var/cache/yum
45
45
46
46
ENV PATH="$PATH:/opt/mssql-tools18/bin"
47
47
Original file line number Diff line number Diff line change @@ -28,20 +28,20 @@ COPY utils ./utils/
28
28
USER root
29
29
30
30
# Install usefull OS packages
31
- RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile
31
+ RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum
32
32
33
33
# Disable announcement plugin of jupyterlab
34
34
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
35
35
36
36
# Install MongoDB Client, We need a special repo for MongoDB as they do their own distribution
37
37
COPY mongodb-org-6.0.repo-x86_64 /etc/yum.repos.d/mongodb-org-6.0.repo
38
38
39
- RUN dnf install -y mongocli
39
+ RUN dnf install -y mongocli && dnf clean all && rm -rf /var/cache/yum
40
40
41
41
# Install MSSQL Client, We need a special repo for MSSQL as they do their own distribution
42
42
COPY mssql-2022.repo-x86_64 /etc/yum.repos.d/mssql-2022.repo
43
43
44
- RUN ACCEPT_EULA=Y dnf install -y mssql-tools18 unixODBC-devel
44
+ RUN ACCEPT_EULA=Y dnf install -y mssql-tools18 unixODBC-devel && dnf clean all && rm -rf /var/cache/yum
45
45
46
46
ENV PATH="$PATH:/opt/mssql-tools18/bin"
47
47
You can’t perform that action at this time.
0 commit comments