Docker incantations

 I find docker a bit obscure so I will list a short list of commands here to jog my memory.

Build the docker container:

docker compose up 

or

docker-compose up

See what docker containers are running to get their IDs

docker ps -a

Login to a container using bash: (while running):

docker exec -it d762049858c7 bash

See what the password/s are including for mysql for a docker container:

docker inspect d762049858c7 | grep -i password

Nuke the container to edit it to rebuild:

docker compose down

Copy a local file to a running container:

docker cp /path/to/local/file d762049858c7:/path/inside/container/

See what is going on:

docker logs d762049858c7

Get the container IP address:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d762049858c7


Popular posts from this blog

throttle traffic on apache

Pause a program which is using too much CPU

/var/log/journal taking up lots of space