DSCI 522 Lecture 2

Conda-lock, Containerization, and Docker

Sky Sheng

Image generated by OpenAI GPT-5

environment.yml file

environment.yml file with package versions listed

The python script is here: GitHub repo: append_version_to_environment_yml

Conda-lock

🧐 Why do we need Conda-lock?

  • Conda-lock solves the dependency for all platforms (Linux, Windows, MacOS)
  • Here is a conda tree showing how Conda solves dependencies for a simple conda environment.
  • Below is the code I used to generate the conda tree:
#| eval: false
conda activate myenv
conda install -c conda-forge graphviz conda-tree
conda-tree deptree --dot > file.dot
dot -Tpdf file.dot -o tree.pdf

Docker

Docker Container

Virtual Machine vs. Container

Source: eG innovations