Skip to content

Commit c43daf0

Browse files
committed
Fixed linting issues with images, and added support for hadolint ignore rules
1 parent 98474ed commit c43daf0

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed

.github/workflows/ci-eds-notebooks.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
uses: aphp/ci-workflows/.github/workflows/container-ci.yml@dev
1616
with:
1717
dockerfile-path: "eds-base-notebook/Dockerfile"
18+
ignore_hadolint_rules: "DL3008,DL3016"
1819
image-name: "ghcr.io/aphp/base-eds-notebook"
1920
image-custom-tag: "x86_64-ubuntu-24.04"
2021
extra-build-args: |
@@ -39,6 +40,7 @@ jobs:
3940
if: ${{ needs.eds-base-notebook.result == 'success' }}
4041
with:
4142
dockerfile-path: "eds-ocaml-notebook/Dockerfile"
43+
ignore_hadolint_rules: "DL3008,DL3016"
4244
image-name: "ghcr.io/aphp/base-ocaml-notebook"
4345
image-custom-tag: "x86_64-ubuntu-24.04"
4446
extra-build-args: |

eds-base-notebook/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ ARG NOTEBOOK_IMAGE
1313
ARG NOTEBOOK_MAINTAINER
1414

1515
# Defining labels
16-
LABEL MAINTAINER="I&D/SAT/AAM"
17-
LABEL GIT_PROJECT=${GIT_PROJECT}
18-
LABEL GIT_BRANCH=${GIT_BRANCH}
19-
LABEL GIT_COMMIT_AUTHOR=${GIT_COMMIT_AUTHOR}
20-
LABEL GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
16+
LABEL maintainer="I&D/SAT/AAM"
17+
LABEL git-project=${GIT_PROJECT}
18+
LABEL git-branch=${GIT_BRANCH}
19+
LABEL git-commit-author=${GIT_COMMIT_AUTHOR}
20+
LABEL git-commit-sha=${GIT_COMMIT_SHA}
2121

2222
# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
2323
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
@@ -34,9 +34,9 @@ ENV NOTEBOOK_GIT_BRANCH=${GIT_BRANCH}
3434
ENV NOTEBOOK_GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
3535

3636
# Installing extra requirements
37-
RUN apt update --yes && \
38-
apt upgrade --yes && \
39-
apt install --yes --no-install-recommends \
37+
RUN apt-get update --yes && \
38+
apt-get upgrade --yes && \
39+
apt-get install --yes --no-install-recommends \
4040
bash-completion \
4141
fonts-firacode \
4242
openssh-client \
@@ -51,7 +51,7 @@ RUN apt update --yes && \
5151
vim \
5252
curl \
5353
tree &&\
54-
apt clean && \
54+
apt-get clean && \
5555
rm -rf /var/lib/apt/lists/*
5656

5757
# Installing language-servers Lab extensions as global packages, fto prevent the node_module folder from being erased at runtime
@@ -103,8 +103,8 @@ USER root
103103

104104
# Setting permissions and freezing base env
105105
RUN fix-permissions "/home/${NB_USER}" && \
106-
chown -R root:root ${CONDA_DIR} && \
107-
chmod -R 755 ${CONDA_DIR}
106+
chown -R root:root "${CONDA_DIR}" && \
107+
chmod -R 755 "${CONDA_DIR}"
108108

109109

110110
# Switching to NB_USER that will be the runtime notebook user

eds-ocaml-notebook/Dockerfile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ ARG NOTEBOOK_IMAGE
1212
ARG NOTEBOOK_MAINTAINER
1313

1414
# Defining labels
15-
LABEL MAINTAINER="I&D/SAT/AAM"
16-
LABEL GIT_PROJECT=${GIT_PROJECT}
17-
LABEL GIT_BRANCH=${GIT_BRANCH}
18-
LABEL GIT_COMMIT_AUTHOR=${GIT_COMMIT_AUTHOR}
19-
LABEL GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
15+
LABEL maintainer="I&D/SAT/AAM"
16+
LABEL git-project=${GIT_PROJECT}
17+
LABEL git-branch=${GIT_BRANCH}
18+
LABEL git-commit-author=${GIT_COMMIT_AUTHOR}
19+
LABEL git-commit-sha=${GIT_COMMIT_SHA}
2020

2121
ENV DEFAULT_SWITCH_DIR="/opt/opam/switches/default"
2222
ENV KERNEL_DIR="/opt/conda/share/jupyter/kernels/ocaml-jupyter-default"
@@ -34,8 +34,8 @@ ENV NOTEBOOK_GIT_BRANCH=${GIT_BRANCH}
3434
ENV NOTEBOOK_GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
3535

3636
# Installing OPAM + OCAML requirements
37-
RUN apt update --yes && \
38-
apt install --yes --no-install-recommends \
37+
RUN apt-get update --yes && \
38+
apt-get install --yes --no-install-recommends \
3939
make \
4040
gcc \
4141
opam \
@@ -45,12 +45,12 @@ RUN apt update --yes && \
4545
libgmp-dev \
4646
libzmq5-dev \
4747
rsync && \
48-
apt clean && \
48+
apt-get clean && \
4949
rm -rf /var/lib/apt/lists/*
5050

5151
# Creating the base ocaml switch and kernel dirs, and setting suitable ownership
52-
RUN mkdir -p ${DEFAULT_SWITCH_DIR} && \
53-
chown -Rv ${NB_USER}:${NB_GROUP} ${DEFAULT_SWITCH_DIR}
52+
RUN mkdir -p "${DEFAULT_SWITCH_DIR}" && \
53+
chown -Rv "${NB_USER}:${NB_GROUP}" "${DEFAULT_SWITCH_DIR}"
5454

5555

5656
# Switching to NB_USER for local tools/libs installation
@@ -64,8 +64,8 @@ RUN opam init --yes \
6464
--bare \
6565
--auto-setup \
6666
--shell bash && \
67-
opam switch create --empty ${DEFAULT_SWITCH_DIR} && \
68-
eval $(opam env --switch=/opt/opam/switches/default --set-switch) && \
67+
opam switch create --empty "${DEFAULT_SWITCH_DIR}" && \
68+
eval "$(opam env --switch=/opt/opam/switches/default --set-switch)" && \
6969
opam update \
7070
--all \
7171
--repositories \
@@ -76,17 +76,17 @@ RUN opam init --yes \
7676
--yes
7777

7878
# Generating the Jupyter Kernel genspec file that will be used by Jupyter to install the OCAML Kernel
79-
RUN eval $(opam env --switch=/opt/opam/switches/default --set-switch) && \
79+
RUN eval "$(opam env --switch=/opt/opam/switches/default --set-switch)" && \
8080
opam exec -- ocaml-jupyter-opam-genspec && \
81-
grep topfind /home/${NB_USER}/.ocamlinit || echo '#use "topfind";;' >> /home/${NB_USER}/.ocamlinit && \
82-
grep Topfind.log /home/${NB_USER}/.ocamlinit || echo 'Topfind.log:=ignore;;' >> /home/${NB_USER}/.ocamlinit
81+
grep topfind "/home/${NB_USER}/.ocamlinit" || echo '#use "topfind";;' >> "/home/${NB_USER}/.ocamlinit" && \
82+
grep Topfind.log "/home/${NB_USER}/.ocamlinit" || echo 'Topfind.log:=ignore;;' >> "/home/${NB_USER}/.ocamlinit"
8383

8484

8585
#Switching back to root to install OPAM Kernel system-wide
8686
USER root
8787

8888
# Installing the OCAML Kernel from the genspec file generated earlier
89-
RUN eval $(opam env --switch=/opt/opam/switches/default --set-switch) && \
89+
RUN eval "$(opam env --switch=/opt/opam/switches/default --set-switch)" && \
9090
jupyter kernelspec install \
9191
--sys-prefix \
9292
--name "ocaml-jupyter-default" \

0 commit comments

Comments
 (0)