Changing Docker Storage Driver

Hi,

I notice that when using setup_remote_docker the storage driver used is aufs. I’m wondering if there is a way to change the storage driver to overlay2. Given that aufs is no longer recommended by Docker, what are the plans to move away from it?

Thanks

For anyone interested I was able to change the service definition for docker and restart the daemon such that it uses overlay2:

- run:
    name: Switch to overlay2 storage driver
    # Edit docker service file to use overlay2 instead of aufs
    command: |
      ssh remote-docker \<< EOF
        sudo sed -i 's/aufs/overlay2/' /etc/systemd/system/docker.service.d/10-machine.conf
        sudo systemctl daemon-reload
        sudo systemctl restart docker.service
      EOF

The name/path of this may not be reliable, so I tried adding a daemon.json file at /etc/docker/daemon.json instead with the following command:

- run:
    name: Switch to overlay2 storage driver
    command: |
      ssh remote-docker \<< EOF
        echo '{"storage-driver":"overlay2"}' | sudo tee /etc/docker/daemon.json
        sudo systemctl daemon-reload
        sudo systemctl restart docker.service
      EOF

The above works, but because the service definition at /etc/systemd/system/docker.service.d/10-machine.conf includes --storage-driver aufs I saw that an error was being thrown on start up. So one way or another you need to remove/change the storage-driver flag from the service definition.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.