Sign inSign up

smc181002/docker_enabled

By smc181002

•Updated about 6 years ago

Image
0

266

smc181002/docker_enabled repository overview

⁠This docker image has the ability to run the docker commands of the host from the container.

But for this to work you need to do some adjustments to your HOST OS.

  • First, locate your docker.service file.
    In centos, it is located at /usr/lib/systemd/system/
  • Then in the 14th line, you will encounter this command: ExecStart=/usr/bin/dockerd -H fd://.
    Add -H tcp://0.0.0.0:4243 to that line so it looks like :
⁠ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:4243
  • then run the following commands:
    systemctl dameon-reload
    systemctl restart docker

Now you are good to go and run your container

⁠For your reference, here is my Dockerfile

FROM centos:latest # 8
RUN dnf install 'dnf-command(config-manager)' -y
RUN dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
RUN dnf install docker-ce --nobest -y
RUN echo "export DOCKER_HOST=`/sbin/ip route|awk '/default/ { print $3 }'`:4243" | cat >> $HOME/.bashrc

Tag summary

Content type

Image

Digest

Size

230.1 MB

Last updated

over 6 years ago

docker pull smc181002/docker_enabled