Documentation for the DataJoint’s Miniconda3 Image¶
conda.Image Hierarchy¶
Launch Locally¶
Debian¶
docker-compose -f dist/debian/docker-compose.yaml --env-file config/.env up --build
Alpine¶
docker-compose -f dist/alpine/docker-compose.yaml --env-file config/.env up --build
Features¶
Provides a minimal docker image with
conda,python, andpip.Adds
conda-forgechannel as default.Disables
condaauto-update functionality. This prevents the image from growing large between builds. To update, invokeconda updateexplicitly.Includes
en_US.UTF-8locale.Creates an internal system user
anaconda. By default, utilizesanaconda:anacondawhen creating containers.Image avoids using
rootto preserve possible privilege escalation vulnerabilities on docker host. As a means to perform installs while underanaconda:anaconda, you may utilize any combination of the following and trigger it via/entrypoint.sh [command to run once completed]e.g./entrypoint.sh echo done.Debian dependencies: Create a
\ndelimited file containing the system dependencies at/tmp/apt_requirements.txt. This can be created manually within container/image or mounted in.Alpine dependencies: Create a
\ndelimited file containing the system dependencies at/tmp/apk_requirements.txt. This can be created manually within container/image or mounted in.Conda dependencies: Create a
\ndelimited file containing the conda dependencies at/tmp/conda_requirements.txt. This can be created manually within container/image or mounted in.Pip dependencies: Create a
\ndelimited file containing the pip dependencies at/tmp/pip_requirements.txt. This can be created manually within container/image or mounted in.
When mounting volumes (avoid mounting files with
rootpermissions only!), accessing files within image viaanaconda:anacondacan result in permission denied errors. To avoid this, simply add auserspec indocker-compose.yamlwith the appropriateHOST_UIDe.g.user: 1000:anaconda. Running/entrypoint.shwill then trigger a reassociation ofanaconda’s UID to allow permissions to access mounted files. Note thatentrypoint.shis automatically invoked when starting containers. If you are utilizing the included referencedocker-compose.yamlfiles, you may simply set theHOST_UIDenvironment value when building or starting the container.Allows user anaconda to be renamed by setting environment variable NEW_USER before launching container.
Allows user’s HOME directory to be moved to a new directory based on setting environment variable NEW_HOME before launching container. Behavior is that it will move the directory but also create a symbolic link from /home/${USER} to the new HOME for convenience.
Applies image compresssion.
Usage Notes¶
As long as a container user is a member of
anacondagroup, they should have acccess to performcondaandpipoperations within the default environment i.e.base.To properly shell into the container and activate the default environment, see the
CMDspecification in theDockerfile. For example:docker exec -it debian_app_1 bash || docker exec -it alpine_app_1 sh
When installing a
condapackage, make sure to pin thepythonversion to prevent upgrade within thebaseenvironment or perform thecondainstall in a newcondaenvironment.
Testing¶
To rebuild and run tests locally, execute the following statements:
set -a # automatically export sourced variables
. config/.env # source config for build and tests
docker buildx bake -f dist/${DISTRO}/docker-compose.yaml --set *.platform=${PLATFORM} --set *.context=. --load # build image
tests/main.sh # run tests
set +a # disable auto-export behavior for sourced variables
Miniconda3 Release Archive¶
Miniconda3 releases are pulled from 2 mirrored targets:
Compatible
condareleases obey the following regex:Miniconda3-py[0-9]+_[0-9.]+-Linux-x86_64\.sh
Acknowledgements¶
Development for this image was heavily borrowed from https://github.com/ContinuumIO/docker-images.