- Download docker toolbox
- Copy
images/boot2docker.isotoc:/users/[user]/.docker/machine/cache
- Go to "Settings" menu.
- Select "Startup > Tasks"
- Click on "+" button to add new task.
- Provide name as "Docker"
- Set value text area with:
"-new_console:d:C:\Program Files\Docker Toolbox" "%ConEmuDrive%\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"
Run docker run hello-world. After a while, you should see a message "Hello from Docker!". There is a delay because it needs to download the hello-world package from the remote location. Subsequent invocations will display the response immediately.
- build the image:
docker build -t friendlyhello . - run the container:
docker run -p 4000:80 friendlyhello
docker run -d -p 4000:80 friendlyhello
Command | Description --|---|-- docker ps | List containers docker ps -a | List all containers docker container ls | List containers docker images | List images docker stop {container name}|stop container docker login | login to docker cloud docker {tag} {image} {username}/{repository}:{tag} | tag repository docker image rm {image id} | remove image docker image rm {image id} --force | remove image (forced) docker update --restart=no $(docker container ls -a -q) | Remove auto-restart from all containers
Command | Description
--|---|--
docker build -t friendlyname . | Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname | Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname | Same thing, but in detached mode
docker container ls | List all running containers
docker container ls -a | List all containers, even those not running
docker container stop | Gracefully stop the specified container
docker container kill | Force shutdown of the specified container
docker container rm | Remove specified container from this machine
docker container rm $(docker container ls -a -q) | Remove all containers
docker image ls -a | List all images on this machine
docker image rm | Remove specified image from this machine
docker image rm $(docker image ls -a -q) | Remove all images from this machine
docker login | Log in this CLI session using your Docker credentials
docker tag
username/repository:tag | Tag
for upload to registry
docker push username/repository:tag | Upload tagged image to registry
docker run username/repository:tag | Run image from a registry
docker-machine ip default
docker swarm init --advertise-addr $(docker-machine ip default)
docker stack deploy -c docker-compose.yml getstartedlab
docker run --net=host -ti ubuntu:14.04 bash