# Change docker location

**URL:** <https://deeptalk.lambda.ai/t/change-docker-location/4158>\
**Category:** Technical Help\
**Created:** [March 26, 2024, 8:34am UTC](https://deeptalk.lambda.ai/t/change-docker-location/4158 "2024-03-26T08:34:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kresimir58](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@kresimir58](https://deeptalk.lambda.ai/u/kresimir58)\
**Post date:** [March 26, 2024, 8:34am UTC](https://deeptalk.lambda.ai/t/change-docker-location/4158/1 "2024-03-26T08:34:56Z")

</div>

I am using a lot of docker and since i ocasionally turn on/off instances, i would like that data to be saved to storage.

I’ve changed location of docker:

nano /etc/docker/daemon.json  
{  
“data-root”: “/home/ubuntu/storage1-utah/docker”  
}

sudo systemctl daemon-reload  
sudo systemctl restart docker

And docker hello-world example works, but other things don’t, like pulling various images:

docker pull ubuntu  
docker: failed to register layer: open /var/lib/dpkg/info/gcc-12-base:amd64.list: invalid argument.

I think it is somehow related to docker not working on storage.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![cody\_b](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cody\_b](https://deeptalk.lambda.ai/u/cody_b)\
**Post date:** [March 26, 2024, 7:42pm UTC](https://deeptalk.lambda.ai/t/change-docker-location/4158/2 "2024-03-26T19:42:37Z")

</div>

Hi,

I couldn’t reproduce the problem you’re experiencing.

Here’s my Docker version:

```bash
$ docker --version
Docker version 24.0.6, build ed223bc

```

Here’s what my `daemon.json` looks like:

```bash
$ cat /etc/docker/daemon.json
{
    "default-runtime": "nvidia",
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "nvidia-container-runtime"
        }
    },
    "data-root": "/home/ubuntu/persistent-storage/docker"
}

```

Here’s the output of `docker image pull ubuntu`:

```bash
$ docker image pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
bccd10f490ab: Pull complete 
Digest: sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest

```

Here’s confirmation `data-root` is my persistent storage:

```bash
$ sudo ls -al ~/persistent-storage/docker
total 12
drwx--x--- 12 root root 11 Mar 26 19:04 .
drwxr-xr-x 4 ubuntu ubuntu 2 Mar 26 19:30 ..
drwx--x--x 4 root root 7 Mar 26 19:04 buildkit
drwx--x--- 2 root root 0 Mar 26 19:24 containers
-rw------- 1 root root 36 Mar 26 19:04 engine-id
drwx------ 3 root root 1 Mar 26 19:04 image
drwxr-x--- 3 root root 1 Mar 26 19:04 network
drwx------ 4 root root 2 Mar 26 19:04 plugins
drwx------ 2 root root 0 Mar 26 19:04 runtimes
drwx------ 2 root root 0 Mar 26 19:04 swarm
drwx------ 2 root root 0 Mar 26 19:24 tmp
drwx--x--- 3 root root 2 Mar 26 19:04 vfs
drwx-----x 2 root root 2 Mar 26 19:04 volumes

```

Also, user `ubuntu` is in the `docker` group:

```bash
$ id --groups --name
ubuntu users admin docker

```
