This intends to be a list of easy to find useful commands for working with docker. If you are looking for information about docker go to Docker docs homepage
To remove all the containers:
$ docker rm $(docker ps -aq)
To open a shell in a new container sharing a folder:
$ docker run -t -i -v /my/own/dir:/opt/ myImageName
To open a shell in a running container:
$ docker exec -t -i myContainerName /bin/bash
See container IP address:
$ docker inspect myContainerName | grep IPAddress
Launch an image in background:
$docker run -d myImageName
To assign a private IP to a docker container:
$ docker network create --subnet=10.0.0.0/16 myDockerNet $ docker run --net myDockerNet --ip 10.0.0.2 -d myImageName
To copy a file to a container:
docker cp localfile myContainerName:remotefile
To copy a file from a container:
docker cp myContainerName:remotefile localfile