-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
James Taylor edited this page Nov 3, 2022
·
6 revisions
Random collection of docker commands!
docker container run -t <image> <cmd>
docker container exec -it <container> <cmd>
docker container ls
docker container run --detach --publish 8080:80 --name nginx nginx
docker container inspect nginx
docker container logs <container>
docker system prune
docker image build -t <name> .
docker image ls
Explore an image...
docker run -it --rm --entrypoint /bin/sh <image>
Explore a container...
docker exec -it <container> /bin/sh
Copy a file...
docker cp $(docker create --rm <name>):<src> ./<dest>
nginx...
docker run -it --rm -d -p 8080:80 --name web nginx
play-with-docker.com
Copying a file from an image without starting a container, e.g. when the image is for another architecture...
docker create --name fab ibmcom/ibp-microfab
docker cp fab:/opt/microfab/bin/microfabd microfabd
docker rm fab