// set variable export POSTGRES_PASSWORD='password' // use it later docker run -e POSTGRES_PASSWORD -e POSTGRES_USER ...
docker logs infrastructure-rabbitmq-1 # or docker logs d3387e01e7cd
docker ps # or docker container ls -a
Remove specific container
docker rm d3387e01e7cd
docker stopalso works with container id
Get into container shell/terminal
docker exec [container-id or name] [shell - can be bash or ash]
-itis short for interactive
- Alpine is like a bare bones linux
docker image prunewill clear up a bunch of space for you. But you’d have to rebuild images & such.
TIL: difference between attach & exec:
attachisn’t for running an extra thing in a container, it’s for attaching to the running process.
docker execis specifically for running new things in a already started container, be it a shell or some other process. src
- This could make for a good read