Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dcmcand optimize docker files #625

Merged
merged 24 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions conda-store-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM --platform=linux/amd64 condaforge/mambaforge:23.3.1-1 as base
FROM condaforge/mambaforge:23.3.1-1 as base

LABEL org.opencontainers.image.authors="conda-store development team"

ENV PATH=/opt/conda/condabin:/opt/conda/envs/conda-store-server/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH}
ENV TZ=America/New_York
ENV TZ=Etc/UTC

RUN apt-get update && \

Check warning on line 8 in conda-store-server/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store-server)

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
# https://docs.anaconda.org/anaconda/install/linux/#installing-on-linux
apt-get install -yq --no-install-recommends \
libgl1-mesa-glx \
Expand Down Expand Up @@ -41,7 +41,8 @@

COPY environment.yaml /opt/conda-store-server/environment.yaml

RUN mamba env create -f /opt/conda-store-server/environment.yaml
RUN mamba env create -f /opt/conda-store-server/environment.yaml && \
conda clean --force-pkgs-dirs

COPY ./ /opt/conda-store-server/

Expand All @@ -51,14 +52,15 @@

FROM base as prod
ARG RELEASE_VERSION
RUN cd /opt/conda-store-server && \

Check warning on line 55 in conda-store-server/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store-server)

Use WORKDIR to switch to a directory
/opt/conda/envs/conda-store-server/bin/pip install conda-store-server==${RELEASE_VERSION}
/opt/conda/envs/conda-store-server/bin/pip install conda-store-server==${RELEASE_VERSION} && \
rm -rf /opt/conda-store-server/tests

WORKDIR /var/lib/conda-store

FROM base as dev

RUN cd /opt/conda-store-server && \

Check warning on line 63 in conda-store-server/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store-server)

Use WORKDIR to switch to a directory
/opt/conda/envs/conda-store-server/bin/pip install -e .

WORKDIR /var/lib/conda-store
10 changes: 6 additions & 4 deletions conda-store/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM --platform=linux/amd64 condaforge/mambaforge:23.3.1-1 as base
FROM condaforge/mambaforge:23.3.1-1 as base

LABEL org.opencontainers.image.authors="conda-store development team"

RUN apt-get update && \

Check warning on line 5 in conda-store/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store)

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -yq --no-install-recommends curl && \
apt-get clean && \
rm -rf /var/cache/apt/* &&\
Expand All @@ -15,7 +15,9 @@

COPY environment.yaml /opt/conda-store/environment.yaml

RUN mamba env create -f /opt/conda-store/environment.yaml
RUN mamba env create -f /opt/conda-store/environment.yaml && \
mamba clean --all -y && \
conda clean --force-pkgs-dirs

ENV PATH=/opt/conda/condabin:/opt/conda/envs/conda-store/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH}

Expand All @@ -23,13 +25,13 @@

FROM base as prod
ARG RELEASE_VERSION
RUN cd /opt/conda-store && \

Check warning on line 28 in conda-store/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store)

Use WORKDIR to switch to a directory

Check warning on line 28 in conda-store/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store)

Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
pip install conda-store==${RELEASE_VERSION}
USER conda-store
WORKDIR /opt/jupyterhub

FROM base as dev
RUN cd /opt/conda-store && \
pip install -e .
RUN --mount=type=cache,target=/root/.cache/pip cd /opt/conda-store && \

Check warning on line 34 in conda-store/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store)

Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`

Check warning on line 34 in conda-store/Dockerfile

View workflow job for this annotation

GitHub Actions / Build docker images (conda-store)

Use WORKDIR to switch to a directory
pip install -e . --no-cache
USER conda-store
WORKDIR /opt/jupyterhub
Loading