From 2a290dbcaf5c8539a497007aa789fbbbdc9d9e1d Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 14 Aug 2024 13:51:37 +0100 Subject: [PATCH] Unify ENV command in Dockerfiles --- docs/using/recipe_code/microsoft_odbc.dockerfile | 2 +- docs/using/recipe_code/oracledb.dockerfile | 4 ++-- docs/using/recipes.md | 8 ++++---- images/all-spark-notebook/Dockerfile | 2 +- images/docker-stacks-foundation/Dockerfile | 2 +- images/pytorch-notebook/cuda11/Dockerfile | 8 ++++---- images/pytorch-notebook/cuda12/Dockerfile | 8 ++++---- images/tensorflow-notebook/cuda/Dockerfile | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/using/recipe_code/microsoft_odbc.dockerfile b/docs/using/recipe_code/microsoft_odbc.dockerfile index 1138d69f79..b0970372fe 100644 --- a/docs/using/recipe_code/microsoft_odbc.dockerfile +++ b/docs/using/recipe_code/microsoft_odbc.dockerfile @@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] USER root -ENV MSSQL_DRIVER "ODBC Driver 18 for SQL Server" +ENV MSSQL_DRIVER="ODBC Driver 18 for SQL Server" ENV PATH="/opt/mssql-tools18/bin:${PATH}" RUN apt-get update --yes && \ diff --git a/docs/using/recipe_code/oracledb.dockerfile b/docs/using/recipe_code/oracledb.dockerfile index 8846fe6c21..5684e2a055 100644 --- a/docs/using/recipe_code/oracledb.dockerfile +++ b/docs/using/recipe_code/oracledb.dockerfile @@ -34,8 +34,8 @@ RUN wget --progress=dot:giga "${INSTANTCLIENT_URL}/oracle-instantclient-basiclit # And configure variables RUN echo "ORACLE_HOME=/usr/lib/oracle/${INSTANTCLIENT_MAJOR_VERSION}/client64" >> "${HOME}/.bashrc" && \ - echo "PATH=${ORACLE_HOME}/bin:${PATH}" >> "${HOME}/.bashrc" && \ - echo "LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}" >> "${HOME}/.bashrc" && \ + echo "PATH=\"${ORACLE_HOME}/bin:${PATH}\"" >> "${HOME}/.bashrc" && \ + echo "LD_LIBRARY_PATH=\"${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}\"" >> "${HOME}/.bashrc" && \ echo "export ORACLE_HOME" >> "${HOME}/.bashrc" && \ echo "export PATH" >> "${HOME}/.bashrc" && \ echo "export LD_LIBRARY_PATH" >> "${HOME}/.bashrc" diff --git a/docs/using/recipes.md b/docs/using/recipes.md index f42696d016..3abbd6c0dd 100644 --- a/docs/using/recipes.md +++ b/docs/using/recipes.md @@ -301,10 +301,10 @@ This recipe is not tested and might be broken. FROM quay.io/jupyter/all-spark-notebook # Set env vars for pydoop -ENV HADOOP_HOME /usr/local/hadoop-2.7.3 -ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 -ENV HADOOP_CONF_HOME /usr/local/hadoop-2.7.3/etc/hadoop -ENV HADOOP_CONF_DIR /usr/local/hadoop-2.7.3/etc/hadoop +ENV HADOOP_HOME=/usr/local/hadoop-2.7.3 +ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +ENV HADOOP_CONF_HOME=/usr/local/hadoop-2.7.3/etc/hadoop +ENV HADOOP_CONF_DIR=/usr/local/hadoop-2.7.3/etc/hadoop USER root # Add proper open-jdk-8 not the jre only, needed for pydoop diff --git a/images/all-spark-notebook/Dockerfile b/images/all-spark-notebook/Dockerfile index 1a97294b2f..53f3c8a6cc 100644 --- a/images/all-spark-notebook/Dockerfile +++ b/images/all-spark-notebook/Dockerfile @@ -14,7 +14,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] USER root # RSpark config -ENV R_LIBS_USER "${SPARK_HOME}/R/lib" +ENV R_LIBS_USER="${SPARK_HOME}/R/lib" RUN fix-permissions "${R_LIBS_USER}" # R pre-requisites diff --git a/images/docker-stacks-foundation/Dockerfile b/images/docker-stacks-foundation/Dockerfile index 84d57235e9..7852fe9d26 100644 --- a/images/docker-stacks-foundation/Dockerfile +++ b/images/docker-stacks-foundation/Dockerfile @@ -20,7 +20,7 @@ USER root # Install all OS dependencies for the Server that starts # but lacks all features (e.g., download as all possible file formats) -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update --yes && \ # - `apt-get upgrade` is run to patch known vulnerabilities in system packages # as the Ubuntu base image is rebuilt too seldom sometimes (less than once a month) diff --git a/images/pytorch-notebook/cuda11/Dockerfile b/images/pytorch-notebook/cuda11/Dockerfile index 3894f1b4ea..d19d0f1234 100644 --- a/images/pytorch-notebook/cuda11/Dockerfile +++ b/images/pytorch-notebook/cuda11/Dockerfile @@ -21,10 +21,10 @@ RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index fix-permissions "/home/${NB_USER}" # https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#dockerfiles -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +ENV NVIDIA_VISIBLE_DEVICES="all" \ + NVIDIA_DRIVER_CAPABILITIES="compute,utility" # Puts the nvidia-smi binary (system management interface) on path # with associated library files to execute it -ENV PATH=${PATH}:/usr/local/nvidia/bin -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64 +ENV PATH="${PATH}:/usr/local/nvidia/bin" \ + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64" diff --git a/images/pytorch-notebook/cuda12/Dockerfile b/images/pytorch-notebook/cuda12/Dockerfile index 99416a26e3..36b60d38c1 100644 --- a/images/pytorch-notebook/cuda12/Dockerfile +++ b/images/pytorch-notebook/cuda12/Dockerfile @@ -21,10 +21,10 @@ RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index fix-permissions "/home/${NB_USER}" # https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#dockerfiles -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +ENV NVIDIA_VISIBLE_DEVICES="all" \ + NVIDIA_DRIVER_CAPABILITIES="compute,utility" # Puts the nvidia-smi binary (system management interface) on path # with associated library files to execute it -ENV PATH=${PATH}:/usr/local/nvidia/bin -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64 +ENV PATH="${PATH}:/usr/local/nvidia/bin" \ + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64" diff --git a/images/tensorflow-notebook/cuda/Dockerfile b/images/tensorflow-notebook/cuda/Dockerfile index 8854276184..f27ba2bd2f 100644 --- a/images/tensorflow-notebook/cuda/Dockerfile +++ b/images/tensorflow-notebook/cuda/Dockerfile @@ -32,5 +32,5 @@ ENV NVIDIA_VISIBLE_DEVICES="all" \ # Puts the nvidia-smi binary (system management interface) on path # with associated library files to execute it -ENV PATH=${PATH}:/usr/local/nvidia/bin -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64 +ENV PATH="${PATH}:/usr/local/nvidia/bin" \ + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64"