From c773aa12c1e7687a0c93ba48b7903416ebaa3f33 Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Thu, 27 Feb 2020 14:12:42 -0500 Subject: [PATCH] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index f1b5595a4..3010cc76b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,32 @@ It does this by performing multiple solves for conda targeting a set of platform This also has the added benefit of acting as an external presolve for conda as the lockfiles it generates results in the conda solver *not* being invoked when installing the packages from the generated lockfile. +## why? + +Conda environment.yaml files are very useful for defining desired environments but there are times when we want to +be able to EXACTLY reproduce an environment by just installing and downloading the packages needed. + +This is particularly handy in the context of a gitops style setup where you use conda to provision environments in +various places + +### Dockerfile example + +In order to use conda-lock in a docker-style context you want to add the lockfile to the +docker container. In order to refresh the lock file just run `conda-lock` again. +``` + Dockerfile + environment.yaml +* conda-linux-64.lock +``` + +```Dockerfile +# Dockerfile +FROM something + +ADD conda-linux-64.lock /locks/conda-linux-64.lock +RUN conda create -p /opt/env --copy --file /locks/conda-linux-64.lock +``` + ## installation ```