Is a tool designed to make it easier to create, deploy, and run applications by using containers.
Check images available locally:
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
imageName tagName someId randomDate someMBs
Build an image from a dockerfile:
$ docker build -t myapp:1.0 .
Delete an image from the local image store:
$ docker rmi alpine:3.4
Docker Hub
Cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images
Login with your docker hub account:
$ docker login
Retag a local image with a new image name and tag
$ docker tag alpine:3.4 myrepo/myalpine:3.4
Push an image to the registry:
$ docker push myrepo/myalpine:3.4
Grab an image from remote registry:
$ docker pull alpine:3.4
Run a container:
$ docker run
--rm
-it
--name containerName
-p 5000:80
-v ~/dev:/code
alpine:3.4
/bin/sh
$ docker stop containerName
$ docker kill containerName
Stop running a container:
Run a container:
$ docker ps
$ docker ps -a
$ docker rm containerId
$ docker rm -f $(docker ps -aq)
Delete containers:
Excute process inside the container and connect it to the terminal:
$ docker exec -it containerName commandName
$ docker logs containerName
Print logs:
Compose is a tool for defining and running multi-container Docker applications.
$ docker-compose start
$ docker-compose stop
$ docker-compose pause
$ docker-compose unpause
$ docker-compose ps
$ docker-compose up
$ docker-compose down