Answers: <p>Oh! I have search for a while, it's should be like:</p>
  
  <pre><code>docker run -d --name=ak_registry  --restart=always -p 7900:5000   -v /data/.docker:/var/lib/registry    registry
  </code></pre>
  
  <p>Used <code>/var/lib/registry</code> instead of <code>/tmp/registry</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2018-08-10T06:25:57.073Z
Answers: 2018-08-10T06:25:57.073Z
Answers: Frank AK
Body: <p>I want to build private docker hub. and I did it with:</p>
  
  <pre><code> docker run -it --restart=always -p 7901:5000   -v /data/registry:/tmp/registry registry /bash/bin
  </code></pre>
  
  <p>And my disk informations as below:</p>
  
  <pre><code>[root@10-19-47-24 docker]# df -lh
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/vda1        20G  4.4G   16G  22% /
  devtmpfs        3.9G     0  3.9G   0% /dev
  tmpfs           3.9G     0  3.9G   0% /dev/shm
  tmpfs           3.9G  401M  3.5G  11% /run
  tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
  /dev/vdb         60G  572M   60G   1% /data
  tmpfs           783M     0  783M   0% /run/user/0
  tmpfs           783M     0  783M   0% /run/user/1001
  tmpfs           783M     0  783M   0% /run/user/1000
  overlay          20G  4.4G   16G  22% /var/lib/docker/overlay2/9923f757c58c0792526f4cb32750401847f127b9e33c0dc78a29d7933bcde5bf/merged
  shm              64M     0   64M   0% /var/lib/docker/containers/51959fbdc1663f968eff770d54c56bc04ddaba2c2d3623058c90a00f582fa40c/mounts/shm
  </code></pre>
  
  <p>And my version of docker is:</p>
  
  <pre><code>[root@10-19-47-24 docker]# docker --version
  Docker version 18.06.0-ce, build 0ffa825
  </code></pre>
  
  <p>And I can push <code>hello-world</code> to the hub, but I can't see anything inside the <code>/data/registry</code>. My question is where is my registry? Is there any mistake of my command?</p>
  
Tags: <docker><centos>
Title: why can't map local path to docker's inside?
UserDisplayName: Frank AK
ThreadText: # why can't map local path to docker's inside?
  
  (Asked by: username_0 on 2018-08-10)
  
  I want to build private docker hub. and I did it with:
  
  ```
   docker run -it --restart=always -p 7901:5000   -v /data/registry:/tmp/registry registry /bash/bin
  
  ```
  
  And my disk informations as below:
  
  ```
  [root@10-19-47-24 docker]# df -lh
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/vda1        20G  4.4G   16G  22% /
  devtmpfs        3.9G     0  3.9G   0% /dev
  tmpfs           3.9G     0  3.9G   0% /dev/shm
  tmpfs           3.9G  401M  3.5G  11% /run
  tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
  /dev/vdb         60G  572M   60G   1% /data
  tmpfs           783M     0  783M   0% /run/user/0
  tmpfs           783M     0  783M   0% /run/user/1001
  tmpfs           783M     0  783M   0% /run/user/1000
  overlay          20G  4.4G   16G  22% /var/lib/docker/overlay2/9923f757c58c0792526f4cb32750401847f127b9e33c0dc78a29d7933bcde5bf/merged
  shm              64M     0   64M   0% /var/lib/docker/containers/51959fbdc1663f968eff770d54c56bc04ddaba2c2d3623058c90a00f582fa40c/mounts/shm
  
  ```
  
  And my version of docker is:
  
  ```
  [root@10-19-47-24 docker]# docker --version
  Docker version 18.06.0-ce, build 0ffa825
  
  ```
  
  And I can push `hello-world` to the hub, but I can't see anything inside the `/data/registry`. My question is where is my registry? Is there any mistake of my command?
  
  **Tags:** docker, centos
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-08-10. Score: 1 | Accepted answer
  
  Oh! I have search for a while, it's should be like:
  
  ```
  docker run -d --name=ak_registry  --restart=always -p 7900:5000   -v /data/.docker:/var/lib/registry    registry
  
  ```
  
  Used `/var/lib/registry` instead of `/tmp/registry`
  
  
  ---
  
  