Enable Docker Remote API – raspberry pi / raspbian

My starting point is:

  • How to use docker remote api to create container?,

so I edit /etc/init/docker.conf and update 2 occurrences of the DOCKER_OPTS variable to:

  • How to fix the WARNINGs when running the redis:alpine Docker image
  • Jenkins - Docker integration - Use Jenkins to build Docker images and push to the registry
  • how to set docker container hostname/IP permanently
  • Some exposed Docker ports are not accessible from outside (dovecot, postfix)
  • Logs of a docker container
  • Installing github hosted npm dependencies with Docker
  • DOCKER_OPTS='-H tcp:// -H unix:///var/run/docker.sock'

    Then, a simple test to list docker images fails:

    $ service docker restart
    $ curl -X GET
    curl: (7) Failed to connect to port 4243: Connection refused

    Docker version is:

    $ sudo docker version
     Version:      1.12.3
     API version:  1.24
     Go version:   go1.6.3
     Git commit:   6b644ec
     Built:        Wed Oct 26 19:06:36 2016
    OS/Arch:      linux/arm
     Version:      1.12.3
     API version:  1.24
     Go version:   go1.6.3
     Git commit:   6b644ec
     Built:        Wed Oct 26 19:06:36 2016
     OS/Arch:      linux/arm

  • Unable to install npm with node 6 due to unmet dependencies on ubuntu
  • has the linux kernel support sctp protocol in container of LXC/docker yet?
  • Docker: connect EHOSTUNREACH when I connect to mongo container
  • How to configure Docker to communicate over the network?
  • RabbitMQ on Docker: Permission denied when chown-ing erlang cookie
  • Docker increase disk space
  • 2 Solutions collect form web for “Enable Docker Remote API – raspberry pi / raspbian”

    Not tested this, but if it’s Jessie, then it uses systemd by default as the init system iirc, and this has implications for how the daemon (dockerd) is configured and started.

    So you’re editing the /etc/init/docker.conf file but I don’t think that’s being read / used.

    Take a read of this article on different startup procedures on each init system in Docker, and this for specific systemd configuration.

    The solution comes from the comments of this page: http://www.virtuallyghetto.com/2014/07/quick-tip-how-to-enable-docker-remote-api.html

    [08/18/2016 at 6:00 am] Oliver Weise says:
    Thanks, that put me in the right direction. However since Ubuntu 16.04
    with its systemd docker daemon the /etc/default/docker is no longer
    effective. Instead you need to create a systemd dropin file.

    I placed such a file under: /etc/systemd/system/docker.service.d/remote-api.conf

    With the contents:

    ExecStart=/usr/bin/dockerd -H tcp:// -H unix:///var/run/docker.sock

    (Yes, the double ExecStart is necessary)

    After that run:

    sudo systemctl daemon-reload // reloading daemon definitions
    sudo systemctl restart docker
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.