Closed pcolmer closed 4 years ago
Hi,
Would you be open to submitting a PR that does this?
@nickjj I'll certainly give it a try.
The "easy" option of just setting up /etc/docker/daemon.json
before Docker is installed is a fairly trivial change and I should be able to get that done today.
There is a bigger picture, though, and that is supporting changes to the graph
value before and after Docker is installed. That is a much more complex bit of logic and therefore more complex playbook to put together. I will have a go at doing that, though, if for no other reason than it will help improve my Ansible skills :) It won't be today though ... :)
Fixed in master.
By default, docker will use
/var/lib/docker
for its files. However, we tend to use/srv/docker
as our/srv/
partitions are where we store the application files and data, so it tends to be much bigger than the root partition.Telling docker to use a different directory is achieved by setting the
graph
value in/etc/docker/daemon.json
. If the file exists before docker is installed then it uses it straightaway and nothing gets created in/var/lib
.However, when I try to set
graph
via the playbook configuration, everything installs but the service then fails to start. I think this is happening because docker is installed then/etc/docker/daemon.json
is created, which means that docker has already set up/var/lib/docker
.Would it be possible to move the initialization of
/etc/docker/daemon.json
to before you install docker so that it picks up the values before it first runs?