Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
docker

docker

Delete all containers

docker rm container $(docker ps -a -q)

Delete all images

docker rmi $(docker images -q)

IP of container

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

bash shell

docker exec -it CONTAINER_ID /bin/bash

start docker image with port forwarding between host and container

docker run -p 3000:3000 IMAGE_ID

run docker image for debugging

docker run --rm -it IMAGE_ID

docker-compose

service="web"
docker-compose run $service /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment