From wikieduonline
Jump to navigation Jump to search

Docker is a software utility to pack, ship and run any containers application available since March 2013.


Docker offer the following features:

Installing Docker[edit]

You can read official Docker documentation about installing Docker on your system:

On macOS you can follow official documentation which requires to create and account to download installer. You can also try: brew cask install docker or try to follow instructions:

brew install docker docker-compose docker-machine(to install docker and docker-compose)
brew cask install virtualbox
docker-machine create --driver virtualbox default
docker-machine ls
docker-machine env default
eval $(docker-machine env default)
docker run hello-world (will pull hello-world image and run it on docker)



Following binaries will be installed: docker-init, docker-proxy, docker and dockerd

Verifying Docker installation[edit]

Once installed the Docker daemon, called "dockerd" should be running. You can also run docker run hello-world to verify docker correct installation.

Configuration files[edit]



/var/lib/docker/ (The Docker daemon was explicitly designed to have exclusive access to)[2]

Docker Releases (Docker Engine release notes)[edit]

Use: docker version[3] to check your version. You can download Docker CE source code from GitHub[4].

Docker Command Line[edit]

You can read official docker command line documentation in Before being able to run docker commands you will have to install Docker on your machine.

Some typical task using containers:

Docker verification commands[edit]

  • Verify correct installation: docker run hello-world

You will see some message similar to this one:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:97ce6fa4b6cdc0790cda65fe7290b74cfebd9fa0c9b8c38e979330d547d22ce1
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:

For more examples and ideas, visit:

Docker image and container creation[edit]

  • Create a new docker image base on alpine linux distribution and login into the new container: docker run -it alpine sh
  • Create a new docker image: docker build
    • Create a new docker image by creating a new text file with instructions, usually called Dockerfile[5]: docker build -f /path/to/a/Dockerfile .
  • Create a container: docker create
  • Generate a mediawiki:1.27 image: docker build --tag mediawiki:1.27 . (you can use -t or --tag)
  • Execute or run a container based on mediawiki:1.27 image: docker run --name wikiFGA -p -d mediawiki:1.27

Docker Container Operation[edit]

  • Login/Connect into a running container:
    • docker exec[11] -it <my_container_name> bash
    • docker exec -it <my_container_name> sh
    • docker run -it --user USER_NAME CONTAINER_NAME
  • Start stopped containers: docker start $(docker ps -a -q -f status=exited)
  • Restart all containers: docker restart $(docker ps -aq) previously docker restart $(docker ps -q)-a all -q quiet[12]

See also: docker compose and docker stack

Docker images management[edit]

Docker Network command line commands[edit]

Docker resource limitation[edit]

Docker: Working with remote repositories/registries[edit]

You will be using mainly the following commands docker login, docker logout, docker pull and docker push. Docker registry allow to configure notifications. [18]. Docker has a public repository called Docker Hub and cloud providers offer repositories services such as AWS Elastic Container Registry (ECR).

Docker Information[edit]

Docker Operation[edit]

Docker/cgroup Performance information[edit]

Docker Swarm[edit]


  • docker system prune -a remove unused and dangling images. Therefore any images being used in a container, whether they have been exited or currently running, will NOT be affected.[23]. See also: docker system info

Docker Volumes[edit]

Related terms: Bind Mounts


Docker logging[edit]

Related terms[edit]


  1. Read docker blog:
  2. Read Docker Engine release notes (2017) and Docker CE or Docker EE releases.
  3. Understand the difference between an image and a container, Docker Images vs. Containers:
  4. Understand the difference between docker start and docker run: See also runC
  5. Read Stackoverflow questions related to docker:
  6. Read about Docker Image Manifest Version 2, Schema 2:
  7. Duplicate and image using docker commit command

See also[edit]

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.


  22. <