Skip to content

Commit

Permalink
Try mambaorg/micromamba base image
Browse files Browse the repository at this point in the history
  • Loading branch information
ethho committed Sep 18, 2024
1 parent 764ae93 commit 26050ca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
32 changes: 22 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
ARG PY_VER=3.9
ARG IMAGE=jupyter/docker-stacks-foundation
ARG IMAGE=mambaorg/micromamba:1.5-bookworm-slim
FROM ${IMAGE}
RUN conda install -y -n base -c conda-forge python=${PY_VER} git graphviz pydot && \
conda clean -afy
USER 1000

ARG CONDA_BIN=micromamba
ARG PY_VER=3.9
ARG HOST_UID=1000

RUN ${CONDA_BIN} install --no-pin -qq -y -n base -c conda-forge \
python=${PY_VER} pip setuptools git graphviz pydot && \
${CONDA_BIN} clean -qq -afy

COPY --chown=${HOST_UID:-1000}:mambauser ./pyproject.toml ./README.md ./LICENSE.txt /main/
COPY --chown=${HOST_UID:-1000}:mambauser ./datajoint /main/datajoint

VOLUME /src
WORKDIR /tmp
COPY --chown=1000:100 ./pyproject.toml ./README.md ./LICENSE.txt /main/
COPY --chown=1000:100 ./datajoint /main/datajoint
WORKDIR /src
USER root
RUN \
pip install --no-cache-dir /main && \
chown -R ${HOST_UID:-1000}:mambauser /main && \
chown -R ${HOST_UID:-1000}:mambauser /src && \
eval "$(micromamba shell hook --shell bash)" && \
micromamba activate base && \
pip install -q --no-cache-dir /main && \
rm -r /main/*
WORKDIR /src
USER ${MAMBA_USER}
ENV PATH="$PATH:/home/mambauser/.local/bin"
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ services:
dockerfile: Dockerfile
args:
PY_VER: ${PY_VER:-3.8}
HOST_UID: ${HOST_UID:-1000}
depends_on:
db:
condition: service_healthy
Expand All @@ -60,7 +61,7 @@ services:
- PYTHON_USER=dja
- JUPYTER_PASSWORD=datajoint
working_dir: /src
user: 1000:100
user: ${HOST_UID:-1000}:mambauser
volumes:
- .:/src
djtest:
Expand Down

0 comments on commit 26050ca

Please sign in to comment.