What is this?
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 bash
or sh
. Other tutorials will lean on this on this foundation.
Why make this?
To keep it in a spot I remember and to share simple things with others.
Steps
- Run the Ubuntu image with the
-i
and-t
flags. 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!
docker ps
# ubuntu-playground will be in the NAMES column
- Install and run some stuff
# From prompt inside container
apt-get update
apt-get install -y curl jq
curl https://jsonplaceholder.typicode.com/users/1 | jq
- Profit 🤑
Top comments (0)