Skip to content

Commit 41d5bd8

Browse files
committed
improved lock file documentation
1 parent 4db2399 commit 41d5bd8

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ using [conda-lock](https://github.com/conda-incubator/conda-lock) or
160160
micromamba:
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
171171
FROM 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+
177186
When a lockfile is used to create an environment, the `micromamba create ..`
178187
command does not query the package channels or execute the solver. Therefore
179188
using a lockfile has the added benefit of reducing the time to create a conda

0 commit comments

Comments
 (0)