Custom images allow you to define workspaces that include the dependencies, scripts, and user preferences helpful for your project.
This guide assumes that you're familiar with:
For ideas on what you can include in your images, see:
Instead of starting from scratch, we recommend extending one of our sample images:
# Dockerfile FROM codercom/enterprise-base:ubuntu USER root # Add software, files, dev tools, and dependencies here RUN apt-get install -y ... COPY file ./ USER coder ...
Coder workspaces mount a home volume. Any files in the image's home directory will be replaced by this persistent volume. If you have install scripts (e.g., those for Rust), you must configure them to install software in another directory.
If you're using a different base image, see our image minimum requirements to make sure that your image will work with all of Coder's features.
If you're using CVM-only features during an image's build time (e.g., you're pre-loading images in workspaces), you may need to install the sysbox runtime onto your local machine and build your images locally. Note that this isn't usually necessary, even if your image installs and enables Docker.
This snippet shows you how to install a JetBrains IDE onto your image so that you can use it in your Coder workspace:
# Dockerfile FROM ... # Install IDEs as root USER root RUN mkdir -p /opt/[IDE] RUN curl -L \ "https://download.jetbrains.com/product?code=[CODE]&latest&distribution=linux" \ | tar -C /opt/[IDE] --strip-components 1 -xzvf - # Add a binary to the PATH that points to the IDE startup script. RUN ln -s /opt/[IDE]/bin/idea.sh /usr/bin/[IDE]
Make sure that you replace
[IDE] with the name of the IDE in lowercase and
More specifically, here's how to install the IntelliJ IDE onto your image:
# Dockerfile FROM ... USER root # Install intellij RUN mkdir -p /opt/idea RUN curl -L "https://download.jetbrains.com/product?code=IIC&latest&distribution=linux" \ | tar -C /opt/idea --strip-components 1 -xzvf - # Create a symbolic link in PATH that points to the Intellij startup script. RUN ln -s /opt/idea/bin/idea.sh /usr/bin/intellij-idea-community