测试人社区

vmware安装ubuntu之后搭建docker需要用到的内容

1.安装vim命令
sudo apt-get install vim
此时安装可能会存在问题,我安装时提示E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 716,没有关系,使用ps afx|grep apt查找出占用apt的进程,使用sudo kill掉该进程就行; 注意这条进程5044 pts/0 S+ 0:00 _ grep --color=auto apt不能被kill掉;
2.安装docker
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common #安装一些必备的工具软件
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88 #校验key
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
配置源文件
/etc/docker/daemon.json
{
“registry-mirrors”: [
https://mirror.ccs.tencentyun.com
]
}
之后systemctl restart docker生效;
sudo apt-get update
安装nginx
docker pull nginx