Dockerfiles in Code Ocean
Last updated
Was this helpful?
Last updated
Was this helpful?
Code Ocean uses Docker to create the software environment for a capsule. A Dockerfile is a document that contains all the commands required to assemble the environment.
Within a capsule, click on the environment directory in the file tree system to open the Environment Editor. This is a user-friendly interface that allows you to create a Dockerfile without needing to know any Docker syntax. First, select your preferred starter environment (the base image), and then customize it further using the package manager.
To manually customize your capsule environment you can open the Dockerfile and unlock it. This is not recommended as it will permanently disable the environment editor and all subsequent changes to the environment will need to be made through the Dockerfile.
When adapting an existing project to Code Ocean, you may already have a Dockerfile that you’d like to use. In this case, you could:
Parse your local Dockerfile and add each comment to your capsule's Dockerfile with the environment editor
If the Code Ocean starter environments don't provide for your specific requirements, contact your administrator to create a custom Docker image for you.
Put all of your dependencies in a requirements.txt or environment.yml file, click the gear icon next to the appropriate package manager, select edit bulk and upload your file. Learn more in the section of the documentation.