修改docker镜像提高下载速度
原本下载路径是国外的路径 使用docker info命令查看运行以下命令修改路径:命令:sudo sed -i "s|EXTRA_ARGS='|EXTRA_ARGS='--registry-mirror=https://registry.docker-cn.com |g" /var/lib/boot2docker/profileexit docker-machine r...
原本下载路径是国外的路径
使用docker info命令查看
运行以下命令修改路径:
命令:
sudo sed -i "s|EXTRA_ARGS='|EXTRA_ARGS='--registry-mirror=https://registry.docker-cn.com |g" /var/lib/boot2docker/profile
exit
docker-machine restart default
docker info
在镜像(ubuntu)中启动一个容器,命名为docker_server
docker run -it 镜像名称 /bin/bash 这个命令用来从镜像中启动一个容器并进入不退出
更新镜像
-y是同意协议,继续安装
文件路径可以写一半然后用tab生成,最后的.bak要自己补全
按i进入插入模式
把下面内容粘贴进去
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
按ESC退出insert模式
然后按shift和冒号键wq保存
路径改成阿里云
更多推荐
所有评论(0)