You are not logged in.
Hello,
I'm trying to configure a docker, but I don't really know how to do it. First I read the documentation from the wiki, but it wasn't enough. I did the same configuration on Ubuntu, but there, the docker config file is different.
I want to configure the docker like this (Ubuntu configuration):
DOCKER_OPTS="--bip=172.17.42.1/16 --dns=172.17.42.1 -H tcp://192.168.1.1:4243 -H unix:///var/run/docker.sock"Could somebody give me a hint?
Thank you!
Last edited by Paul15071992 (2014-12-10 10:31:46)
Offline
You need to setup a systemd override file with the correct options. I'm on mobile right so I can't easily give an example... Hopefully that sends you in the right direction for now.
Scott
Edit (at my computer now):
Create file /etc/systemd/system/docker.d/my_config.conf
[Service]
ExecStart=
ExecStart=/usr/bin/docker --bip=172.17.42.1/16 --dns=172.17.42.1 -H tcp://192.168.1.1:4243 -H unix:///var/run/docker.sockFrom 'man systemd.unit':
Along with a unit file foo.service, a directory foo.service.d/ may exist. All
files with the suffix ".conf" from this directory will be parsed after the file
itself is parsed. This is useful to alter or add configuration settings to a
unit, without having to modify their unit files. Make sure that the file that
is included has the appropriate section headers before any directive. Note that
for instanced units this logic will first look for the instance ".d/"
subdirectory and read its ".conf" files, followed by the template ".d/"
subdirectory and reads its ".conf" files.You have to put the blank ExecStart= line in to ensure that directive gets overridden.
Last edited by firecat53 (2014-11-27 18:31:28)
Offline
I did that and then restarted the docker, but after the restart, when using the command
systemctl status dockerI get the a failure
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
Active: failed (Result: exit-code) since Fri 2014-11-28 10:37:18 CET; 1min 24s ago
Docs: http://docs.docker.com
Process: 1813 ExecStart=/usr/bin/docker --bip=172.17.42.1/16 --dns=172.17.42.1 -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock (code=exited, status=1/FAILURE)
Main PID: 1813 (code=exited, status=1/FAILURE)Offline
Two things:
1. Provide the relevant journactl output for docker.service
2. Try starting docker from the command line directly with those options to make sure you got the options right
Scott
Offline
journalctl output:
-- Logs begin at Thu 2014-08-07 19:22:23 CEST, end at Mon 2014-12-01 09:15:44 CET. --
Dec 01 09:15:15 paulArchie docker[347]: 2014/12/01 09:15:15 Received signal 'terminated', starting shutdown of docker...
Dec 01 09:15:15 paulArchie docker[3009]: 2014/12/01 09:15:15 docker daemon: 1.3.2 39fa2fa; execdriver: native; graphdriver:
Dec 01 09:15:15 paulArchie docker[3009]: [63c05fd9] +job serveapi(tcp://127.0.0.1:4243, fd://)
Dec 01 09:15:15 paulArchie docker[3009]: [info] Listening for HTTP on tcp (127.0.0.1:4243)
Dec 01 09:15:15 paulArchie docker[3009]: [info] Listening for HTTP on fd ()
Dec 01 09:15:15 paulArchie docker[3009]: [63c05fd9] +job init_networkdriver()
Dec 01 09:15:15 paulArchie docker[3009]: [63c05fd9] -job init_networkdriver() = OK (0)
Dec 01 09:15:15 paulArchie docker[3009]: 2014/12/01 09:15:15 WARNING: Your kernel does not support cgroup swap limit.
Dec 01 09:15:15 paulArchie docker[3009]: [info] Loading containers:
Dec 01 09:15:15 paulArchie docker[3009]: .....................................................................[info] : done.
Dec 01 09:15:15 paulArchie docker[3009]: [63c05fd9] +job acceptconnections()
Dec 01 09:15:15 paulArchie docker[3009]: [63c05fd9] -job acceptconnections() = OK (0)
Dec 01 09:15:24 paulArchie docker[3009]: 2014/12/01 09:15:24 Received signal 'terminated', starting shutdown of docker...
Dec 01 09:15:25 paulArchie docker[3058]: 2014/12/01 09:15:25 docker daemon: 1.3.2 39fa2fa; execdriver: native; graphdriver:
Dec 01 09:15:25 paulArchie docker[3058]: [307a8255] +job serveapi(tcp://127.0.0.1:4243, fd://)
Dec 01 09:15:25 paulArchie docker[3058]: [info] Listening for HTTP on tcp (127.0.0.1:4243)
Dec 01 09:15:25 paulArchie docker[3058]: [info] Listening for HTTP on fd ()
Dec 01 09:15:25 paulArchie docker[3058]: [307a8255] +job init_networkdriver()
Dec 01 09:15:25 paulArchie docker[3058]: [307a8255] -job init_networkdriver() = OK (0)
Dec 01 09:15:25 paulArchie docker[3058]: 2014/12/01 09:15:25 WARNING: Your kernel does not support cgroup swap limit.
Dec 01 09:15:25 paulArchie docker[3058]: [info] Loading containers:
Dec 01 09:15:25 paulArchie docker[3058]: .....................................................................[info] : done.
Dec 01 09:15:25 paulArchie docker[3058]: [307a8255] +job acceptconnections()
Dec 01 09:15:25 paulArchie docker[3058]: [307a8255] -job acceptconnections() = OK (0)
Dec 01 09:15:44 paulArchie docker[3058]: 2014/12/01 09:15:44 Received signal 'terminated', starting shutdown of docker...
Dec 01 09:15:44 paulArchie docker[3120]: 2014/12/01 09:15:44 Please specify only one -H
Dec 01 09:15:44 paulArchie systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 01 09:15:44 paulArchie systemd[1]: Unit docker.service entered failed state.
Dec 01 09:15:44 paulArchie systemd[1]: docker.service failed.Offline
The drop-in configuration dir should be "docker.service.d". When systemd sees it, any *.conf files should also show up in systemctl status output.
Offline
there is no file
docker.service.dall I have are
/usr/lib/systemd/system/docker.service
/usr/lib/systemd/system/docker.socketOffline
[..]
Create file /etc/systemd/system/docker.d/my_config.conf
[..]
I did that [..]
Offline
I get the same error with the
/etc/systemd/system/docker.service.d/my_config.confError:
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─my_config.conf
Active: failed (Result: exit-code) since Wed 2014-12-03 14:22:48 CET; 9s ago
Docs: http://docs.docker.com
http://docs.docker.com
Process: 6121 ExecStart=/usr/bin/docker --bip=172.17.42.1/16 --dns=172.17.42.1 -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock (code=exited, status=1/FAILURE)
Main PID: 6121 (code=exited, status=1/FAILURE)
Dec 03 14:22:48 irianArchie docker[6121]: 2014/12/03 14:22:48 Please specify only one -H
Dec 03 14:22:48 irianArchie systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 03 14:22:48 irianArchie systemd[1]: Unit docker.service entered failed state.
Dec 03 14:22:48 irianArchie systemd[1]: docker.service failedOffline
I've changed it and now I get this
systemctl restart docker:
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─my_config.conf
Active: failed (Result: start-limit) since Wed 2014-12-03 15:44:24 CET; 38s ago
Docs: http://docs.docker.com
http://docs.docker.com
Process: 9727 ExecStart=/usr/bin/docker --bip=172.17.42.1/16 --dns=172.17.42.1 -H tcp://127.0.0.1:4243 unix:///var/run/docker.sock (code=exited, status=0/SUCCESS)
Main PID: 9727 (code=exited, status=0/SUCCESS)
Dec 03 15:44:24 irianArchie docker[9727]: save Save an image to a tar archive
Dec 03 15:44:24 irianArchie docker[9727]: search Search for an image on the Docker Hub
Dec 03 15:44:24 irianArchie docker[9727]: start Start a stopped container
Dec 03 15:44:24 irianArchie docker[9727]: stop Stop a running container
Dec 03 15:44:24 irianArchie docker[9727]: tag Tag an image into a repository
Dec 03 15:44:24 irianArchie docker[9727]: top Lookup the running processes of a container
Dec 03 15:44:24 irianArchie docker[9727]: unpause Unpause a paused container
Dec 03 15:44:24 irianArchie docker[9727]: version Show the Docker version information
Dec 03 15:44:24 irianArchie docker[9727]: wait Block until a container stops, then print its exit code
Dec 03 15:44:24 irianArchie docker[9727]: Run 'docker COMMAND --help' for more information on a command.docker info:
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?docker -d:
2014/12/03 15:50:38 docker daemon: 1.3.2 39fa2fa; execdriver: native; graphdriver:
[8293e608] +job serveapi(unix:///var/run/docker.sock)
2014/12/03 15:50:38 open /var/run/docker.pid: permission deniedOffline
if I run sudo docker -d, I get
2014/12/04 08:58:56 docker daemon: 1.3.2 39fa2fa; execdriver: native; graphdriver:
[0179cb16] +job serveapi(unix:///var/run/docker.sock)
[info] Listening for HTTP on unix (/var/run/docker.sock)
[0179cb16] +job init_networkdriver()
[0179cb16] -job init_networkdriver() = OK (0)
2014/12/04 08:58:56 WARNING: Your kernel does not support cgroup swap limit.
[info] Loading containers:
.....................................................................[info] : done.
[0179cb16] +job acceptconnections()
[0179cb16] -job acceptconnections() = OK (0)so I think that it works now.
thank you!
~Paul~
Offline
i managed to solve the problem, by exporting my options in DOCKER_HOST and DOCKE_OPTS
Last edited by Paul15071992 (2014-12-04 14:25:24)
Offline
My solution:
/etc/systemd/system/docker.service.d/my_config.conf
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
ExecStart=
ExecStart=/usr/bin/docker -d --bip=172.17.42.1/16 --dns=172.17.42.1 -H tcp://127.0.0.1:4243
LimitNOFILE=1048576
LimitNPROC=1048576
[Install]
WantedBy=multi-user.target
Also=docker.socket.bashrc
export DOCKER_HOST="tcp://127.0.0.1:4243"because the docker is listening to the address "127.0.0.1:4243"
Offline