This is a tutorial on doing Ubuntu stuffs in Docker. It is intended to be a starting off point for doing common things in pretty much any image that can run
sh. Other tutorials will lean on this on this foundation.
To keep it in a spot I remember and to share simple things with others.
- Run the Ubuntu image with the
-tflags. See documentation for more detail
# Run the image directly rather than exec into a container
docker run --name ubuntu-playground -it ubuntu bash
- Optional, verify your new container is running in a separate terminal window. This is a bit redundant since your terminal shell just switched, but it's good to be thorough!
# ubuntu-playground will be in the NAMES column
- Install and run some stuff
# From prompt inside container
apt-get install -y curl jq
curl https://jsonplaceholder.typicode.com/users/1 | jq
- Profit 🤑