-
Notifications
You must be signed in to change notification settings - Fork 0
Docker #38
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
Docker #38
Changes from all commits
1fe7a4d
76f7d9b
1e67aed
2ed947b
5aa4ad9
ef01aa5
1c8b32d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||||
| FROM python:3.10-slim AS stage1 | ||||||||
|
|
||||||||
| FROM mambaorg/micromamba:1.5.5 AS stage2 | ||||||||
|
|
||||||||
| FROM debian:stable-slim AS final | ||||||||
|
|
||||||||
| RUN apt-get update && apt-get install -y ca-certificates | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Without 🔧 Suggested fix-RUN apt-get update && apt-get install -y ca-certificates
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
+ && rm -rf /var/lib/apt/lists/*📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
|
|
||||||||
| COPY --from=stage1 /usr/local /usr/local | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🔧 Suggested fix-FROM python:3.10-slim AS stage1
-
FROM mambaorg/micromamba:1.5.5 AS stage2
FROM debian:12-slim AS final
...
-COPY --from=stage1 /usr/local /usr/local
COPY --from=stage2 /bin/micromamba /usr/local/bin/micromamba🤖 Prompt for AI Agents |
||||||||
| COPY --from=stage2 /bin/micromamba /usr/local/bin/micromamba | ||||||||
|
|
||||||||
| ENV MAMBA_ROOT_PREFIX="/root/micromamba" \ | ||||||||
| CONDA_PREFIX="/root/micromamba/envs/mdx2-dev" \ | ||||||||
| PATH="/root/micromamba/envs/mdx2-dev/bin:/usr/local/bin:/opt/conda/bin:$PATH" | ||||||||
|
|
||||||||
| # Ensure /opt/conda exists for micromamba to use | ||||||||
| RUN mkdir -p /opt/conda | ||||||||
|
|
||||||||
| WORKDIR /home/dev | ||||||||
|
|
||||||||
| COPY env.yaml . | ||||||||
|
|
||||||||
| # Use micromamba to create the environment and install packages | ||||||||
| RUN --mount=type=cache,target=/root/micromamba/pkgs \ | ||||||||
| /usr/local/bin/micromamba create -f env.yaml -n mdx2-dev && \ | ||||||||
| /usr/local/bin/micromamba install -y -n mdx2-dev nexpy jupyterlab jupyterlab-h5web dials xia2 wget tar -c conda-forge | ||||||||
|
|
||||||||
| COPY . . | ||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||
|
|
||||||||
| RUN --mount=type=cache,target=/root/.cache/pip \ | ||||||||
| /usr/local/bin/micromamba run -n mdx2-dev pip install -e . && \ | ||||||||
| /usr/local/bin/micromamba run -n mdx2-dev pip install jupyterhub jupyter-vscode-proxy | ||||||||
|
|
||||||||
| EXPOSE 8888 | ||||||||
|
|
||||||||
| CMD ["/usr/local/bin/micromamba", "run", "-n", "mdx2-dev", "jupyterhub-singleuser"] | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Container runs as Two concerns:
🔧 Suggested fix+RUN useradd -m dev
+USER dev
EXPOSE 8888
-CMD ["/usr/local/bin/micromamba", "run", "-n", "mdx2-dev", "jupyterhub-singleuser"]
+CMD ["/usr/local/bin/micromamba", "run", "-n", "mdx2-dev", "--", \
+ "python", "-m", "jupyterhub_singleuser"]Alternatively, install RUN apt-get install -y --no-install-recommends tini
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/local/bin/micromamba", "run", "-n", "mdx2-dev", "jupyterhub-singleuser"]🤖 Prompt for AI Agents |
||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debian:stable-slimis a mutable/floating tag — pin to a specific version for reproducibility.stablecurrently resolves to Debian 12 (bookworm) but will silently change with the next Debian stable release, breaking reproducible builds.🔧 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents