Docker quick-tips

Spin up a docker container sharing a local folder

docker run -t -i -v /Users/Username/git/projectname-docker:/docker-share local/default:project /bin/bash

The key part to this command is the option parameter

-v [Local directory]:[location in the container]

Show all running containers

docker ps
docker ps -s

Show all containers

docker ps -a

Remove all containers that aren’t running

docker rm `docker ps -aq -f status=exited`

 

Gareth
Buy Me A Coffee
back arrowBack to Index