Rocker is an alternative to docker-compose that makes it easier to run containers with access to features of the local environment and add extra capabilities to existing docker images. I do most of my development in vscode with the devcontainers extension so this wrapper simplifies that workflow. Rather than calling rocker and then attaching vscode, this wrapper combines those actions into one command.
pip install rockervsc
To run rocker and automatically launch and attach a vscode instance, run this command:
rockervsc
You can pass all the normal rocker arguments to rockervsc and it will forward them to rocker, e.g.:
rockervsc --x11 --nvidia
by default rockervsc calls rockerc so instead of passing arguments explicitly you can have a rockerc.yaml file in your workspace
image: ubuntu:22.04
args:
- nvidia
- x11
- user
- git
and running:
rockervsc
will launch and attach vscode to the container with nvidia, x11, the current user id and git set up for you.
I'm not sure this is the best way of implementing rockervsc like functionality. It might be better to implement it as a rocker extension, or in rocker itself. This was just the simplest way to get started. I may explore those other options in more detail in the future.