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-forge
channel as default.Disables
conda
auto-update functionality. This prevents the image from growing large between builds. To update, invokeconda update
explicitly.Includes
en_US.UTF-8
locale.Creates an internal system user
anaconda
. By default, utilizesanaconda:anaconda
when creating containers.Image avoids using
root
to 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
\n
delimited 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
\n
delimited 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
\n
delimited 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
\n
delimited 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
root
permissions only!), accessing files within image viaanaconda:anaconda
can result in permission denied errors. To avoid this, simply add auser
spec indocker-compose.yaml
with the appropriateHOST_UID
e.g.user: 1000:anaconda
. Running/entrypoint.sh
will then trigger a reassociation ofanaconda
’s UID to allow permissions to access mounted files. Note thatentrypoint.sh
is automatically invoked when starting containers. If you are utilizing the included referencedocker-compose.yaml
files, you may simply set theHOST_UID
environment 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
anaconda
group, they should have acccess to performconda
andpip
operations within the default environment i.e.base
.To properly shell into the container and activate the default environment, see the
CMD
specification in theDockerfile
. For example:docker exec -it debian_app_1 bash || docker exec -it alpine_app_1 sh
When installing a
conda
package, make sure to pin thepython
version to prevent upgrade within thebase
environment or perform theconda
install in a newconda
environment.
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
conda
releases 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.