自从Win10安装了Docker for Windows后,C盘容量爆炸,必须做一波迁移了.我的Docker使用的是Windows的Hyper-V虚拟机,于是google了一番找到以下一篇文章 docker for windows pull镜像文件的安装位置改变方法,参照文章的思路来一波Hyper-V虚拟硬盘迁移. 迁移步骤 启动Hyper-V管理器 打开后会发现一个已经在运行的MobyLinuxVM虚拟机(Docker CE已改名叫Moby) 查看MobyLinuxVM虚拟硬盘设置(可跳过)
镜像启动时,自动执行的是~/.bashrc文件,所以,环境变量需要配置在该文件内,这样镜像启动时,可自动执行该文件,使环境变量生效. vi ~/.bashrc ---------------------------------------------------------------------------------- # .bashrc # User specific aliases and functions alias rm='rm -i'alias cp='cp -i'alias
拉取镜像 docker pull redis:4.0 在主机/data/redis/conf目录下新建redis.conf文件vim /data/redis/conf/redis.conf # Redis configuration file example. # # Note that in order to read the configuration file, Redis must be # started with the file path as first argument: #