Skip to content

Instantly share code, notes, and snippets.

@katrinafyi
Created September 13, 2023 13:37
Show Gist options
  • Save katrinafyi/70cb42295e43aea890cf33c8d74fe5be to your computer and use it in GitHub Desktop.
Save katrinafyi/70cb42295e43aea890cf33c8d74fe5be to your computer and use it in GitHub Desktop.
Temporary persistent Docker containers for experimentation.

temporary docker

Sometimes, you need a fresh system to check your newly-minted README. A virtual machine would be perfect but it's way too much for this. Instead, we can use Docker in its purest form: as a sandbox virtual machine to test our work.

We create a new docker container with a recognisable name.

docker run -td --name ubby -v $HOME:/mnt ubuntu

To open a shell in this container:

docker exec -it ubby bash

It's very minimal but it will get the job done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment