docker容器技术实践
docker常用命令
1.容器操作
docker ps #查看进程
docker start #启动
docker stop
docker restart
docker logs
docker exec #进入容器
docker rm #删除容器
docker rename #重命名
docker cp #拷贝容器内部内容至主机 容器号:容器目录 主机目录
...
2.镜像操作
docker images #查看镜像
docker pull #下载镜像
docker push #上传镜像
docker save #保存镜像
docker load #导入镜像
安装Docker
1.SET UP THE REPOSITORY
sudo apt-get remove docker docker-engine docker.io containerd runc #删除旧版本
sudo apt-get update #更新软件包
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common #Install packages to allow apt to use a repository over HTTPS
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - #Add Docker’s official GPG key
sudo apt-key fingerprint 0EBFCD88 #verify that you now have the key with the fingerprint
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" #set up the stable repository
2.INSTALL DOCKER ENGINE - COMMUNITY
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
3.运行docker
run命令:
ps命令:
images命令:
pull命令:
docker外面的ifconfig:
docker里面的ifconfig:
docker info: