Sunday 23 July 2017

Docker installation on Ubuntu 16.04.2 with TCP API


  1. Install of Ubuntu 16.04.2.
  2. Follow the instructions on https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
  3. Modify /lib/systemd/system/docker.service change:
    • ExecStart=/usr/bin/dockerd fd://        ....to
    • ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375
  4. Modify /etc/init.d/docker change:
    1. DOCKER_OPTS=
    2. DOCKER_OPTS="-H tcp://0.0.0.0:2375"
    Restart docker with:
    • sudo service docker restart
    You will see:

    Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.

    Do this as instructed:
    • systemctl daemon-reload
    ==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
    Authentication is required to reload the systemd state.
    Authenticating as: David Bond,,, (david)
    Password:
    ==== AUTHENTICATION COMPLETE ===

    Then restart again

    • sudo service docker restart
    Check that docker is still available from the command line:
    • docker version
    Client:
     Version:      17.06.0-ce
     API version:  1.30
     Go version:   go1.8.3
     Git commit:   02c1d87
     Built:        Fri Jun 23 21:23:31 2017
     OS/Arch:      linux/amd64

    Server:
     Version:      17.06.0-ce
     API version:  1.30 (minimum version 1.12)
     Go version:   go1.8.3
     Git commit:   02c1d87
     Built:        Fri Jun 23 21:19:04 2017
     OS/Arch:      linux/amd64
     Experimental: false

    Check that the TCP socket is open for requests:
    • curl http://localhost:2375/version
    You will see:

    {"Version":"17.06.0-ce","ApiVersion":"1.30","MinAPIVersion":"1.12","GitCommit":"02c1d87","GoVersion":"go1.8.3","Os":"linux","Arch":"amd64","KernelVersion":"4.8.0-36-generic","BuildTime":"2017-06-23T21:19:04.990631145+00:00"}

    No comments:

    Post a Comment