-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
602efaf
commit fef7643
Showing
5 changed files
with
44 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
FROM mambaorg/micromamba:latest as ENV | ||
|
||
FROM python:latest as BUILD | ||
RUN pip install build | ||
COPY . /src | ||
RUN python -m build /src --outdir /dist | ||
|
||
FROM mambaorg/micromamba:latest | ||
FROM python:3.12-slim | ||
|
||
# COPY FROM https://micromamba-docker.readthedocs.io/en/latest/advanced_usage.html#adding-micromamba-to-an-existing-docker-image | ||
ARG MAMBA_USER=mambauser MAMBA_USER_ID=57439 MAMBA_USER_GID=57439 | ||
ENV MAMBA_USER=$MAMBA_USER MAMBA_ROOT_PREFIX="/opt/conda" MAMBA_EXE="/bin/micromamba" | ||
COPY --from=ENV "$MAMBA_EXE" "$MAMBA_EXE" | ||
COPY --from=ENV /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh | ||
COPY --from=ENV /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh | ||
COPY --from=ENV /usr/local/bin/_entrypoint.sh /usr/local/bin/_entrypoint.sh | ||
COPY --from=ENV /usr/local/bin/_dockerfile_initialize_user_accounts.sh /usr/local/bin/_dockerfile_initialize_user_accounts.sh | ||
COPY --from=ENV /usr/local/bin/_dockerfile_setup_root_prefix.sh /usr/local/bin/_dockerfile_setup_root_prefix.sh | ||
RUN /usr/local/bin/_dockerfile_initialize_user_accounts.sh && \ | ||
/usr/local/bin/_dockerfile_setup_root_prefix.sh | ||
|
||
ARG MAMBA_DOCKERFILE_ACTIVATE=1 | ||
ENV PYTHONUTF8=1 RUN_IN_CONTAINER=1 AEXPY_ENV_PROVIDER=micromamba | ||
ENV PYTHONUTF8=1 RUN_IN_CONTAINER=1 AEXPY_ENV_PROVIDER=micromamba MAMBA_SKIP_ACTIVATE=1 | ||
COPY --from=BUILD /dist /tmp/packages | ||
RUN pip install --no-cache-dir --compile /tmp/packages/*.whl | ||
|
||
USER $MAMBA_USER | ||
WORKDIR /data | ||
VOLUME [ "/data" ] | ||
|
||
COPY --chown=$MAMBA_USER:$MAMBA_USER env.yaml /tmp/env.yaml | ||
RUN micromamba install -y -n base -f /tmp/env.yaml && \ | ||
micromamba clean --all --yes | ||
|
||
COPY --from=BUILD --chown=$MAMBA_USER:$MAMBA_USER /dist /tmp/packages | ||
|
||
RUN pip install --no-cache-dir /tmp/packages/*.whl && \ | ||
rm -rf /tmp/packages | ||
|
||
SHELL ["/usr/local/bin/_dockerfile_shell.sh"] | ||
ENTRYPOINT [ "/usr/local/bin/_entrypoint.sh", "aexpy" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters