Docker

 
 
Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux. Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting virtual machines.

The latest Docker version can be downloaded from: http://www.docker.com

rss feed






Configure Docker daemon to listen to network port instead of local Unix socket



Information
none

Operating system used
Windows Vista Home Premium SP 2

Software prerequisites
Docker on Windows


Procedure
  1. Check if Docker is installed/running, type: docker -v
    You should see:
    Docker version 1.5.0, build a8a31ef

  2. Switch to root user, type: sudo su

  3. Check if Docker is not listening to network port, type: netstat -tlp
    Note: tlp = tcp listening program

    netstat display

    The PID/Program name is showing "1259/sshd", thus there are no Docker program listening on the network ports.

  4. Write down your Docker ip address, type: ifconfig

    Docker ip address

    In this example write down the eth0 address: 192.168.1.67

  5. Stop Docker, type: service docker stop
    You should see:
    docker stop/waiting

  6. Start Docker and let it listen to your network port, type: docker -H 192.168.1.67:2375 -d &

    • Port 2375 is standard Docker non SSL port.
    • -d set in daemon mode

    Set network address

    Note: Press the Enter key to get the prompt back.

  7. Check if Docker is listening to network port, type: netstat -tlp

    Docker is listening to network port

    The PID/Program name is showing "1987/docker", thus Docker is listening to network port.

  8. If you type: docker info or docker version, these commands will fail because the Docker client still communicates with the Docker daemon via the local Unix socket, instead of network port (in this example: 192.168.1.67:2375).

    To fix this, type: export DOCKER_HOST="tcp://192.168.1.67:2375"
    Now the Docker client communicates with the Docker daemon via the network port.

    Docker client using network port

    If you want to undo this step, type: export DOCKER_HOST=

  9. If you want the Docker daemon to listen to the network port AND to the local Unix socket, type:
    docker -H 192.168.1.67:2375 -H unix:///var/run/docker.sock -d &