启动docker
sudo service docker start
查看启动的docker镜像
sudo docker images
查看启动的docker实例化对象,启动的分支
sudo docker ps -a
启动对应docker
docker start tag值
进入docker
docker attach tag值
删除docker实例化对象
sudo docker rm tag值
sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e9533f5e6ec2 no_data_2.0 "/bin/bash" 18 hours ago Exited (127) 4 minutes ago gaia_sanxian_2021-08-02-19-08-58-208495400
caofengtao@GQN000000335990:/$ sudo docker rm e9533f5e6ec2
删除docker的images ,这个是实际占用磁盘空间的
caofengtao@GQN000000335990:$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu18 v2.5 1342c06a6223 4 days ago 3.17GB
werwrwq wewerwq be6137c12b10 2 weeks ago 17.1GB
caofengtao@GQN000000335990:$ sudo docker rmi be6137c12b10
进入docker
git切换分支
查看总共有多少分支git branch -a
切换到分支 git checkout 分支名称
如果宿主机重启了,会导致wsl中的docker重启失败 需要执行sudo service docker start
caof35990:/mnt/$ docker images ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
caof5990:/mnt/d/git_work/sixi$ docker images -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
caofen990:/mnt/d/git_wor$ docker images -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
caofeng35990:/mnt/d/git_work$ docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
caofe5990:/mnt/d/git_work$ sudo service docker start
[sudo] password for caofao:
* Starting Docker: docke
caao@GQN000000335990:/$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
iregistry.baidu-int.com/acu-soc-sixi/ubuntu18 v2.5 1342c06a6223 5 days ago 3.17GB
caofeao@GQN000000335990:/$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
caof@GQN000000335990:/$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
47b9570e4ee2 iregistry.baidu-int.com/acu-soc-sixi/ubuntu18:v2.5 "bash" 24 hours ago Exited (0) 37 seconds ago gaia_sixi_2021-08-03-15-08-01-868762000
caofao@GQN000000335990:/mnt/d/git_work/haoixi$ docker attach 47b9570e4ee2
You cannot attach to a stopped container, start it first
cao@GQN000000335990:/mnt/d/git_work/haomo/baidu/acu/gaia_sixi$ docker start 47b9570e4ee2
47b9570e4ee2
caao@GQN000000335990:/mnt//gaia_sixi$
caofao@GQN000000335990:/mnt/d/git_work/hsixi$ docker attach 47b9570e4ee2
root@GQN000000335990:/# ls