1

I am trying to expose docker remote API on CentOS7.

$ docker version
Client:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-46.el7.centos.14.x86_64
 Go version:      go1.6.3
 Git commit:      cb079f6-unsupported
 Built:           Fri Sep 16 13:24:25 2016
 OS/Arch:         linux/amd64
Server:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-46.el7.centos.14.x86_64
 Go version:      go1.6.3
 Git commit:      cb079f6-unsupported
 Built:           Fri Sep 16 1

I have conf file set up on /etc/systemd/system/docker.service.d/docker-external.conf

 [Service]
ExecStart=
ExecStart=/usr/bin/docker -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock

followed by

systemctl daemon-reload
systemctl docker restart

This doesn't seem to start any docker process on 4243

tgogos
  • 23,218
  • 20
  • 96
  • 128
Ganesh
  • 285
  • 1
  • 3
  • 10

1 Answers1

0

Adding add -H tcp://0.0.0.0:4243 to your /lib/systemd/system/docker.service file then running systemctl daemon-reload, followed by systemctl restart docker helps expose the remote API.

ExecStart=/usr/bin/docker-current daemon \
--exec-opt native.cgroupdriver=systemd \
-H tcp://0.0.0.0:4243 -H unix://var/run/docker.sock \
tgogos
  • 23,218
  • 20
  • 96
  • 128
Ganesh
  • 285
  • 1
  • 3
  • 10
  • A systemd drop-in as I've explained over here would be a more elegant solution: https://stackoverflow.com/a/45545785/414075 – white_gecko Aug 07 '17 at 11:38