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

How do I change the Docker image installation directory?

 
 

You can change Docker's storage base directory (where container and images go) using the -g option when starting the Docker daemon.

  • Ubuntu/Debian: edit your /etc/default/docker file with the -g option: DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4 -g /mnt"

  • Fedora/Centos: edit /etc/sysconfig/docker, and add the -g option in the other_args variable: ex. other_args="-g /var/lib/testdir". If there's more than one option, make sure you enclose them in " ". After a restart, (service docker restart) Docker should use the new directory.

Using a symlink is another method to change image storage.

Caution - These steps depend on your current /var/lib/docker being an actual directory (not a symlink to another location).

1) Stop docker: service docker stop. Verify no docker process is running ps faux
2) Double check docker really isn't running. Take a look at the current docker directory: ls /var/lib/docker/
2b) Make a backup - tar -zcC /var/lib docker > /mnt/pd0/var_lib_docker-backup-$(date +%s).tar.gz
3) Move the /var/lib/docker directory to your new partition: mv /var/lib/docker /mnt/pd0/docker
4) Make a symlink: ln -s /mnt/pd0/docker /var/lib/docker
5) Take a peek at the directory structure to make sure it looks like it did before the mv: ls /var/lib/docker/ (note the trailing slash to resolve the symlink)
6) Start docker back up service docker start
7) restart your containers

Docker change directory的更多相关文章

  1. 【linux】 解决linux下vsftp 500 OOPS: cannot change directory:/home/ftp/ 办法

    用FileZilla连接ftp出现错误,500 OOPS: cannot change directory:/home/ftp 原因是CentOS系统安装了SELinux,因为默认下是没有开启FTP的 ...

  2. Linux vsftpd 无法登录 cannot change directory:xxx priv_sock_get_cmd 问题

    配置vsftpd时本地用户无法切换不能登录问题.问题如下: C:\Users\kai>ftp ftp> open 172.24.144.10 连接到 172.24.144.10. (vsF ...

  3. 不关闭seLinux解决vsftpd服务本地用户不能登录问题(500 OOPS: cannot change directory:/home/***

    这里不讲vsftpd的基本配置,网上教程已经太多了.这里只说seLinux的问题. 日前在CentOS6.5中安装了vsftpd,按照网上搜索的教程,配置好/etc/vsftpd/vsftpd.con ...

  4. 500 OOPS: cannot change directory:/home/test

    问题:  以root   从远程客户端 登录 FTP  一直密码错误.  发现不能以root 登录, 需要创建其它的用户. 创建一个test 用户后(如下): useradd test; passwd ...

  5. 关于ftp用户连接时出现500 OOPS: cannot change directory的解决办法

    RHEL5 中配置好后,今天想在XP下用ftp连接虚拟机中的linux,但ftp连接的时候会出现 "500 OOPS:cannot change directory:/root" ...

  6. 【linux】——FTP出现500 OOPS: cannot change directory的解决方法

    cannot change directory:/home/*** ftp服务器连接失败,错误提示: 500 OOPS: cannot change directory:/home/******* 5 ...

  7. centos vsftp 500 OOPS: cannot change directory:/home/ftp

    系统是CentOS,是RH派系的.我把vsftpd安装配置好了,以为大功告成,但客户端访问提示如下错误:500 OOPS: cannot change directory:/home/ftp原因是他的 ...

  8. rmmod: can't change directory to '/lib/modules': No such file or directory

    [root@iTOP-4412]# mount /dev/sda1 /mnt/udisk/ [root@iTOP-4412]# insmod /mnt/udisk/linux/hello.ko  [ ...

  9. su: warning: cannot change directory to : Permission denied ;-bash: bash_profile: Permission denied

    一.查看主目录权限对不对 1:问题描述 [root@ser6-52 ~]# su - mongodb su: warning: cannot change directory to /home/mon ...

随机推荐

  1. weinre 简记

    在入职不久接触了移动端WEB开发,刚开始遇到的问题就是调试的问题.在PC端的时候,我常常纠结在IE与IE之间,主要的兼容问题还是IE一家子和他们的亲戚(啥多核浏览器,也是各种坑不断)之间.IE虽然问题 ...

  2. MATLAB如何定义函数

    自定义函数的途径:M文件函数(M file function)在线函数(Inline Function)匿名函数(Anonymous Function)1.M文件函数范例function c=myad ...

  3. 涨姿势!手机端的META你知道多少?

    一.天猫 <title>天猫触屏版</title> <meta content="text/html; charset=utf-8" http-equ ...

  4. JavaScript 全栈工程师培训教程(来自阮一峰)

    来源于:https://twitter.com/ruanyf http://www.ruanyifeng.com/blog/2016/11/javascript.html 全栈工程师培训材料,帮助学习 ...

  5. Struts2进行url重写

    一般来说我们在用Struts2进行开发的时候我们的访问url都是带上一些类似于.action或者.do还有用?传递参数,这种访问方式与静态页面的访问相比,我就可以用一些开源的组件来进行url的重写,以 ...

  6. iOS开发,应用间的跳转

    预习:URL由两部分组成-- 1.scheme:协议头(http://  ftp:// 等等) 2.path:路径(URL中path可以没有) 一.简单实现跳转到指定APP(也就是说跳转到的APP必须 ...

  7. Linux_虚拟机_安装VMware Tools

    以root用户执行,否则可能会出现权限不足,无法执行的情况 一.点击安装Vmware Tools   二.拖动安装文件到桌面并解压   三.双击并[在终端中运行]   四.根据提示回车或输入yes   ...

  8. 【BZOJ 2820】YY的GCD

    线性筛积性函数$g(x)$,具体看Yveh的题解: http://sr16.com:8081/%e3%80%90bzoj2820%e3%80%91yy%e7%9a%84gcd/ #include< ...

  9. Spring注解@PostConstruct与@PreDestroy

    关于在spring  容器初始化 bean 和销毁前所做的操作定义方式有三种: 第一种:通过@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作 第二 ...

  10. Windows上python的virtualenv 安装及使用

    源地址:http://blog.csdn.net/liuchunming033/article/details/46008301 VirtualEnv可以方便的解决不同项目对类库的依赖问题. 现实测试 ...