Integrating Docker and Anaconda!

Harshit Dawar
2 min readApr 25, 2020

I have created a docker compose file which is able to download and run anaconda docker image in just one second with only one command.

Link for my Github repository containing this project: https://github.com/HarshitDawar55/Docker_Anaconda_Automation

This docker container which is obtained after running the above command, it already contains many packages installed in it, but still there are many which are not installed and according to the use case we can install them. So, what I did is, in the docker compose file I have defined some environment variables by using them one can easily create a custom environment and install custom packages in that.

File name is docker-compose.yml which should be executed in order to do what I am explaining, and to run the file the only command is “docker-compose up”.

Name of the running container will be “anacondafull”,access to the running container can be obtained by running this command in another tab of the terminal/command prompt, “docker exec -i -t anacondafull bash”.

To create environment from the docker compose file, these steps should be followed:

  • Write the name of the custom environment corresponding to “environment_name” in the docker compose file.
  • Run the following command in the container to create custom environment “conda create -n $environment_name”.

To install package in the custom environment from the docker compose file, these steps should be followed:

  • Write the name of the package corresponding to “package1” in the docker compose file.
  • Run the following command in the container to switch to the custom environment “conda activate $environment_name”.
  • Run the following command in the container to install particular package in the environment “conda install $package1”.

This is all from my side for the project, hope you all embrace my effort!

--

--

Harshit Dawar

AIOPS Engineer, have a demonstrated history of delivering large and complex projects. 14x Globally Certified. Rare & authentic content publisher.