This is an introductory devcontainer lab. Our goal is to learn about devcontainers, how to use them, and how to customize them.
We are using DevPod to make this introduction easier and faster for the participants. DevPod is a tool that allows you to create and manage devcontainers without having to know everything about the underlying technology.
After completing this lab, you will have a better understanding of how to use devcontainers and how to customize them to fit your needs.
- Visual Studio Code
- JetBrains and JetBrains Gateway (Optional)
Other IDEs are supported, but this lab will use VS Code and IntelliJ as examples. For example, if you want to run a fully configured Neovim devcontainer, you can use the following image link: devpod-neovim
-
Set your devpod provider to Docker
devpod provider docker -
Verify your devpod provider
devpod provider list -
Set your IDE to
vscodedevpod ide use vscode -
Create a new devpod with one of the quick start images below
devpod up <image link> -
VS Code will open
Copy the image link to use in step 3 above. You can also use these links to create a Github Codespace.
Use these links if you want to use the DevPod Desktop instead of the CLI to create a new workspace. Clicking on the link will open your DevPod Desktop and create a new workspace with the selected image.
Some options you may want to set for your DevPod Workspace:
-
Set your
dotfilesURLdevpod context set-options DOTFILES_URL <Your dotfiles URL> -
Inject Git credentials into your devpod workspace
devpod context set-options -o SSH_INJECT_GIT_CREDENTIALS=<true|false> -
Inject Docker credentials into your devpod workspa
devpod context set-options -o SSH_INJECT_DOCKER_CREDENTIALS=<true|false> -
For a full list of options, and to veryify your context option settings:
devpod context options
- Use the terminal in VS Code to clone your own repository and start coding
- Add a startup script to your
dotfilesrepository to clone your repositories and run your setup scripts - Make a copy of the provided
.devcontainer.jsonand modify it to customize your devcontainer and IDE settings - Configure your
.devcontainer.jsonfile to install additional tools (Features) - Try using the JetBrains IDE with the devcontainer
- See what other IDEs are supported by DevPod and try one that you use
devpod ide list