Skip to content

Latest commit

 

History

History

conda-pack

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Prerequisites

  • conda-pack
  • either Docker, Podman or Singularity
  • source conda environment needs to be on a linux x64 machine.

Usage

  1. Clone this repository (retrieve Dockerfile/Singularity)
git clone git@github.com:grst/containerize-conda.git
cd containerize-conda/conda-pack
  1. Pack the environment
conda-pack -n <MY_ENV> -o packed_environment.tar.gz
  1. Build the container
# With singularity
singularity build --fakeroot <OUTPUT_CONTAINER.sif> Singularity

# With Docker
docker build . -t <TAG>

# With Podman/Buildah
podman build . -t <TAG>

How it works

Conda environment can't be just "moved" to another location, as some paths are hardcoded into the environment. conda-pack takes care of replacing these paths back to placeholders and creates a .tar.gz archive that contains the environment. This environment can be unpacked to another machine (or, in our case, a container). Running conda-unpack in the environment replaces the placeholders back to the actual paths matching the new location.

Troubleshooting

  • find . -xtype l finds broken symbolic links which leads to a failed container creation...