Skip to content

Instantly share code, notes, and snippets.

@Eduard-gan
Last active November 24, 2018 14:10
Show Gist options
  • Save Eduard-gan/be4c25e05d9c8721f1dac48e974df31f to your computer and use it in GitHub Desktop.
Save Eduard-gan/be4c25e05d9c8721f1dac48e974df31f to your computer and use it in GitHub Desktop.
Change default storage path of dockerd
1) Make sure you're stopped the main daemon: sudo systemctl stop docker ; systemctl status docker
2) Create your new storage directory: sudo mkdir /storage
3) Move existing content to that diractory: sudo mv /var/lib/docker /storage
4) Configure daemon to use new directory: sudo nano /etc/docker/daemon.json
{
"data-root": "/storage/docker"
}
5) Start main daemon again: sudo systemctl start docker ; systemctl status docker
6) Make sure it's running: ps aux | grep -i docker | grep -v grep
7) If it's not try to launch it manually in console and see what happens, Larry: sudo dockerd
Method from dev's github: https://github.com/moby/moby/issues/9889
Documentation on daemon.json in https://docs.docker.com/engine/reference/commandline/dockerd/#/linux-configuration-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment