docker-notebook

My Docker notebook

View the Project on GitHub kyhau/docker-notebook

Docker Installation and Configurations

Installation notes

  1. All major x86 based operating systems, and even some ‘arm’, support Docker, including

    1. Apple OSX/sierraOS
    2. Linux (all flavors)
    3. Microsoft Windows
  2. The three major cloud providers support local image Docker installs as well as container services:

    1. AWS
    2. Azure
    3. Google
  3. How to configure the Docker daemon to start on boot (on Ubuntu)

    1. Use upstart for Ubuntu 14.10 and below
    2. Use systemd for most current Linux distributions (RHEL, CentOS, Fedora, Ubuntu 16.04 and higher)
  4. The following are requirements for Docker to run but are NOT installed as dependencies as they exist on most full system installations:

    1. device-mapper-persistent-data
    2. lvm2
    3. yum-utils
  5. What does a virtual machine directly rely on that a container does not?

    Hypervisor. A virtual machine relies on some type of hypervisor that is responsible for translating calls from applications to the underlying hardware: storage, CPU, and memory requests.

  6. Which of the following items need to be considered before installing Docker Enterprise?

    1. Docker Engine, DTR, and UCP version compatibility
    2. Disk space
    3. Network ports
    4. Time Synchronisation
  7. docker info displays system wide configuration information as seen by the Docker service.

    e.g. See the storage driver Docker is currently using

  8. When Docker is first installed, the installation creates a network interface called docker0 that functions as both:

    1. the ‘gateway’ to the private network on the host, which is used for Docker container communication,
    2. defining the network range available for container IP assignments.

    See also Default bridge network in docker-networking.md.

Configurations files and directories

  1. /run/docker.sock file determines which accounts can use the service.

    1. docker.sock command is owned by docker.
    2. To add a user to this group (to allow them to run Docker commands with unprivileged accounts):

      usermod -aG docker user

  2. /run/docker.pid file contains the PID (Process ID) of the Docker service when it is running.

  3. /etc/docker/daemon.json file is used to override various Docker defaults, including

    1. the Docker logging driver (log-driver)
    2. the Docker storage driver (storage-driver)
  4. /var/lib/docker is the directory on a host, stores Docker image and container layers; unless changed in the configuration or daemon at launch time.

Running an Insecure Docker Registry

On Ubuntu 14.x:

  1. Edit /etc/default/docker file
     # for a registry running on port 80 on example.com.
     DOCKER_OPTS="--insecure-registry registry.example.com -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"
    
  2. sudo service docker restart

On Ubuntu 16.x and CentOS:

  1. Edit /etc/docker/daemon.json file
     {
         "insecure-registries" : ["registry.example.com"]
     }
    
  2. sudo systemctl restart docker