Search This Blog

Tuesday, November 22, 2016

Docker cheat sheet

Start docker image and map a port from the docker image to a port on localhost
docker run -p 127.0.0.1:8806:3306 8538c205bee2
Starts image id 8538c205bee2 and maps internal port 3306 of that image to localhost port 8806.

Open a bash in a running docker image
docker exec -it 8538c205bee2 /bin/bash
Stop all running docker images
docker stop $(docker ps -a -q)
Remove/delete all running docker images
docker rm $(docker ps -a -q)

No comments:

Post a Comment