mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-16 06:22:56 +00:00
Improve Dockerfiles codestyle
This commit is contained in:
@@ -31,7 +31,7 @@ RUN apt-get update --yes && \
|
|||||||
|
|
||||||
USER ${NB_UID}
|
USER ${NB_UID}
|
||||||
|
|
||||||
# Install JupyterLab, Jupyter Notebook, JupyterHub and NBClassic
|
# Install JupyterHub, JupyterLab, NBClassic and Jupyter Notebook
|
||||||
# Generate a Jupyter Server config
|
# Generate a Jupyter Server config
|
||||||
# Cleanup temporary files
|
# Cleanup temporary files
|
||||||
# Correct permissions
|
# Correct permissions
|
||||||
@@ -39,10 +39,10 @@ USER ${NB_UID}
|
|||||||
# files across image layers when the permissions change
|
# files across image layers when the permissions change
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN mamba install --yes \
|
RUN mamba install --yes \
|
||||||
'jupyterlab' \
|
|
||||||
'notebook' \
|
|
||||||
'jupyterhub' \
|
'jupyterhub' \
|
||||||
'nbclassic' && \
|
'jupyterlab' \
|
||||||
|
'nbclassic' \
|
||||||
|
'notebook' && \
|
||||||
jupyter server --generate-config && \
|
jupyter server --generate-config && \
|
||||||
mamba clean --all -f -y && \
|
mamba clean --all -f -y && \
|
||||||
npm cache clean --force && \
|
npm cache clean --force && \
|
||||||
|
@@ -117,9 +117,9 @@ RUN set -x && \
|
|||||||
--root-prefix="${CONDA_DIR}" \
|
--root-prefix="${CONDA_DIR}" \
|
||||||
--prefix="${CONDA_DIR}" \
|
--prefix="${CONDA_DIR}" \
|
||||||
--yes \
|
--yes \
|
||||||
"${PYTHON_SPECIFIER}" \
|
'jupyter_core' \
|
||||||
'mamba' \
|
'mamba' \
|
||||||
'jupyter_core' && \
|
"${PYTHON_SPECIFIER}" && \
|
||||||
rm -rf /tmp/bin/ && \
|
rm -rf /tmp/bin/ && \
|
||||||
# Pin major.minor version of python
|
# Pin major.minor version of python
|
||||||
# https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
|
# https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
|
||||||
|
@@ -15,7 +15,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|||||||
# hadolint ignore=DL3013
|
# hadolint ignore=DL3013
|
||||||
RUN pip install --no-cache-dir --index-url 'https://download.pytorch.org/whl/cpu' \
|
RUN pip install --no-cache-dir --index-url 'https://download.pytorch.org/whl/cpu' \
|
||||||
'torch' \
|
'torch' \
|
||||||
'torchvision' \
|
'torchaudio' \
|
||||||
'torchaudio' && \
|
'torchvision' && \
|
||||||
fix-permissions "${CONDA_DIR}" && \
|
fix-permissions "${CONDA_DIR}" && \
|
||||||
fix-permissions "/home/${NB_USER}"
|
fix-permissions "/home/${NB_USER}"
|
||||||
|
@@ -15,8 +15,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|||||||
# hadolint ignore=DL3013
|
# hadolint ignore=DL3013
|
||||||
RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index-url 'https://download.pytorch.org/whl/cu118' \
|
RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index-url 'https://download.pytorch.org/whl/cu118' \
|
||||||
'torch' \
|
'torch' \
|
||||||
'torchvision' \
|
'torchaudio' \
|
||||||
'torchaudio' && \
|
'torchvision' && \
|
||||||
fix-permissions "${CONDA_DIR}" && \
|
fix-permissions "${CONDA_DIR}" && \
|
||||||
fix-permissions "/home/${NB_USER}"
|
fix-permissions "/home/${NB_USER}"
|
||||||
|
|
||||||
|
@@ -15,8 +15,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|||||||
# hadolint ignore=DL3013
|
# hadolint ignore=DL3013
|
||||||
RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index-url 'https://download.pytorch.org/whl/cu121' \
|
RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index-url 'https://download.pytorch.org/whl/cu121' \
|
||||||
'torch' \
|
'torch' \
|
||||||
'torchvision' \
|
'torchaudio' \
|
||||||
'torchaudio' && \
|
'torchvision' && \
|
||||||
fix-permissions "${CONDA_DIR}" && \
|
fix-permissions "${CONDA_DIR}" && \
|
||||||
fix-permissions "/home/${NB_USER}"
|
fix-permissions "/home/${NB_USER}"
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ RUN mamba install --yes \
|
|||||||
'dask' \
|
'dask' \
|
||||||
'dill' \
|
'dill' \
|
||||||
'h5py' \
|
'h5py' \
|
||||||
'ipympl'\
|
'ipympl' \
|
||||||
'ipywidgets' \
|
'ipywidgets' \
|
||||||
'jupyterlab-git' \
|
'jupyterlab-git' \
|
||||||
'matplotlib-base' \
|
'matplotlib-base' \
|
||||||
@@ -56,7 +56,7 @@ RUN mamba install --yes \
|
|||||||
'sqlalchemy' \
|
'sqlalchemy' \
|
||||||
'statsmodels' \
|
'statsmodels' \
|
||||||
'sympy' \
|
'sympy' \
|
||||||
'widgetsnbextension'\
|
'widgetsnbextension' \
|
||||||
'xlrd' && \
|
'xlrd' && \
|
||||||
mamba clean --all -f -y && \
|
mamba clean --all -f -y && \
|
||||||
fix-permissions "${CONDA_DIR}" && \
|
fix-permissions "${CONDA_DIR}" && \
|
||||||
|
@@ -14,8 +14,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|||||||
# Install tensorflow with pip, on x86_64 tensorflow-cpu
|
# Install tensorflow with pip, on x86_64 tensorflow-cpu
|
||||||
RUN [[ $(uname -m) = x86_64 ]] && TF_POSTFIX="-cpu" || TF_POSTFIX="" && \
|
RUN [[ $(uname -m) = x86_64 ]] && TF_POSTFIX="-cpu" || TF_POSTFIX="" && \
|
||||||
pip install --no-cache-dir \
|
pip install --no-cache-dir \
|
||||||
"tensorflow${TF_POSTFIX}" \
|
"jupyter-server-proxy" \
|
||||||
"jupyter-server-proxy" && \
|
"tensorflow${TF_POSTFIX}" && \
|
||||||
fix-permissions "${CONDA_DIR}" && \
|
fix-permissions "${CONDA_DIR}" && \
|
||||||
fix-permissions "/home/${NB_USER}"
|
fix-permissions "/home/${NB_USER}"
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|||||||
|
|
||||||
# Install TensorFlow, CUDA and cuDNN with pip
|
# Install TensorFlow, CUDA and cuDNN with pip
|
||||||
RUN pip install --no-cache-dir \
|
RUN pip install --no-cache-dir \
|
||||||
"tensorflow[and-cuda]" \
|
"jupyter-server-proxy" \
|
||||||
"jupyter-server-proxy" && \
|
"tensorflow[and-cuda]" && \
|
||||||
fix-permissions "${CONDA_DIR}" && \
|
fix-permissions "${CONDA_DIR}" && \
|
||||||
fix-permissions "/home/${NB_USER}"
|
fix-permissions "/home/${NB_USER}"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user