File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -160,12 +160,12 @@ using [conda-lock](https://github.com/conda-incubator/conda-lock) or
160160micromamba :
161161
162162` ` ` bash
163- docker run -it --rm -v $(pwd):/mnt mambaorg/micromamba:0.24.0 \
164- /bin/bash -c "micromamba install -y -f /mnt/ env.yaml && \
165- micromamba env export --explicit > /mnt/ env.lock"
163+ docker run -it --rm -v $(pwd):/tmp mambaorg/micromamba:0.24.0 \
164+ /bin/bash -c "micromamba create --yes --name new_env --file env.yaml && \
165+ micromamba env export --name new_env --explicit > env.lock"
166166` ` `
167167
168- The lockfile can then be used to create a conda environment :
168+ The lockfile can then be used to install into the pre-existing `base` conda environment :
169169
170170` ` ` Dockerfile
171171FROM mambaorg/micromamba:0.24.0
@@ -174,6 +174,15 @@ RUN micromamba install --name base --yes --file /tmp/env.lock && \
174174 micromamba clean --all --yes
175175` ` `
176176
177+ Or the lockfile can be used to create and populate a new conda environment :
178+
179+ ` ` ` Dockerfile
180+ FROM mambaorg/micromamba:0.24.0
181+ COPY --chown=$MAMBA_USER:$MAMBA_USER env.lock /tmp/env.lock
182+ RUN micromamba create --name my_env_name --yes --file /tmp/env.lock && \
183+ micromamba clean --all --yes
184+ ` ` `
185+
177186When a lockfile is used to create an environment, the `micromamba create ..`
178187command does not query the package channels or execute the solver. Therefore
179188using a lockfile has the added benefit of reducing the time to create a conda
You can’t perform that action at this time.
0 commit comments