1

Can anyone suggest how to change docker image download location?

right now it is stored in /var/lib/docker (500mb only free space).

I referred below links

How to change the docker image installation directory?

https://forums.docker.com/t/how-do-i-change-the-docker-image-installation-directory/1169

but it does not match with my configuration eg. /etc/sysconfig/docker I could not find this file. I followed this link to install (install with dnf method). I am trying to find where it is get install by using linux cli command find / -name -type f "docker" it list /usr/bin/docker. I could not able to open this file in editor it seem like shell script. open that file using VI editor but the file full of junk characters.

Thanks

Community
  • 1
  • 1
Bilal Usean
  • 2,322
  • 3
  • 22
  • 45
  • That only refers to your systems docker configuration file. Please consult the documentation of the software where it explains how it is configured and which file(s) it uses for that and then consult a guide that fits your exact operation system. Not to forget: You might be the person who creates the file, it must not exist before (your mileage may vary, this depends on the concrete software and the package used to install it) – hakre Jul 29 '16 at 05:05
  • Possible duplicate of [How to change the docker image installation directory?](http://stackoverflow.com/questions/24309526/how-to-change-the-docker-image-installation-directory) – hakre Jul 29 '16 at 05:19
  • that questions asked two years back, I am using docker latest version 1.11.2 . configuration does not match with my case. can you read my question fully? – Bilal Usean Jul 29 '16 at 05:23
  • 1
    Please start the docker daemon manually and take a look which files it tries to open (you can do this with `strace` for example). It should show you the location of all files incl. the configuration file. Additionally as I wrote, you should refer to the current documentation not to outdated one (if that is what your comment is about, an older answer can only give the information for the older software, I'm pretty sure you're clever enough to map that on the current version and you're not just stuck on outdated questions, aren't you?). – hakre Jul 29 '16 at 05:32

2 Answers2

0

There is one tricky way to do this.

What you need is just move your data and symlink it to new location without any config changes.

1. service docker stop
2. mv /var/lib/docker /mnt/hugest/disk/ever
3. ln -s /mnt/hugest/disk/ever /var/lib/docker
4. service docker start

It should work just as before.

Evedel
  • 653
  • 5
  • 18
0

I change the default directory using docker daemon command

1) stop docker

systemctl  stop docker

2) move docker images as per your required folder

mv /var/lib/docker /u01/docker

3) start docker daemon with new mount point.

docker daemon -g /u01/docker/

4) open new terminal tab, check the docker images

docker images

note: my case docker version 1.11.2, os:fedora23 64 bit

Bilal Usean
  • 2,322
  • 3
  • 22
  • 45