Docker change directory

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?

Open Source Projects DockerEngine

nhazlettNick HazlettDocker Staff

Apr ‘15

2

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

时间: 2024-12-28 13:29:08

Docker change directory的相关文章

centos yum安装ftp 及解决vsftp错误500 OOPS: cannot change directory:/home/**

centos yum安装ftp 及解决vsftp错误500 OOPS: cannot changedirectory:/home/**   1.查看服务器有没有安装ftp包 rpm -qa |grep vsftp 2.yum  安装 yum -y install vsftpd 3.启动vsftp的服务 service vsftpd start 4.关闭防火墙 service iptables stop 5.测试匿名访问 修改配置文件 vsftpd.conf [[email protected]

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

这里不讲vsftpd的基本配置,网上教程已经太多了.这里只说seLinux的问题. 日前在CentOS6.5中安装了vsftpd,按照网上搜索的教程,配置好/etc/vsftpd/vsftpd.conf,重新启动后,登录实验,又出现了著名的不能设置主目录错误: 500 OOPS: cannot change directory:/home/******* 500 OOPS: child died 再到网上求助,发现多数都是让关掉seLinux服务,我记得以前也是这么做得,不过总觉得是有点因噎废食

【linux】500 OOPS:cannot change directory:/root

在安装完red hat enterprise linux 6.5后,通过ftp不能使用root用户,将/etc/vsftpd/ftpusers和/etc/vsftpd/user_list两个文件中的root通过添加#号注释掉,重启ftp服务:service vsftpd restart后,依然报错:500 OOPS:cannot change directory:/root 通过上网分析为selinux的配置问题,解决办法如下: 1.# setsebool -P ftp_home_dir on 

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

cannot change directory:/home/*** ftp服务器连接失败,错误提示: 500 OOPS: cannot change directory:/home/******* 500 OOPS: child died 解决方法: 在终端输入命令: setsebool -P ftpd_disable_trans 1 service vsftpd restart 就OK了! 原因:这是因为服务器开启了selinux,这限制了FTP的登录.

vsftpd出现“Response: 500 OOPS: cannot change directory”解决方法(转载)

vsftpd出现“Response: 500 OOPS: cannot change directory”解决方法 笔者用的Linux发行版本为centos当用FTP客户端连接时,出现如下错误提示: Response: 500 OOPS: cannot change directory:/home/bhtest 输入命令查看 [[email protected]]# sestatus -b| grep ftpallow_ftpd_anon_write offallow_ftpd_full_acc

卸载驱动出现:rmmod: can't change directory to '/lib/modules': No such file or directory

rmmod: can't change directory to '/lib/modules': No such file or directory 新建目录/lib/modules #mkdir -p /lib/modules 又出现 rmmod: can't change directory to '2.6.32.2-FriendlyARM': No such file or directory 继续新建 #mkdir -p /lib/modules/2.6.32.2-FriendlyARM

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. 220 (vsFTPd 2.2.2) 用户(172.24.144.10:(none)): fftp 331 Please specify the password. 密码: 500 OOPS: cannot change directory:/home/fftp 500 OOPS: priv_sock_get_cmd

使用客户端登陆ftp 500 OOPS: cannot change directory:/root

使用客户端登陆ftp 500 OOPS: cannot change directory:/root解决 可以在windows上使用一ftp客户端来尝试进行登录.这个时候一般都会报一个错误. 无效的用户权限错误 删除ftpuser 里面的root和user_list 里的root 最好关掉linux 的防火墙:chkconfig iptables off 然后再次登录 500 OOPS: cannot change directory:/root 解决办法: 1. 查看 SELinux 的状态:

用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission denied

用root帐号切换其他帐号提示: 出错原因: 基本上是根目录或者是/home/oracle目录权限的问题 解决办法: 更改根目录权限为755,并保证对应用户主目录的所属用户和所属组一致和用户名一致. 示例: --本篇文章转自http://blog.csdn.net/jack161641/article/details/7090490 用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission d