下载docker镜像
docker pull ubuntu
查看docker镜像
docker images
搜索docker镜像
docker search centos
开启docker容器
docker run --name ubuntu -dit ubuntu:latest /bin/bash
docker run --name centos_fund0.3 --privileged=true -dit -p 3306:3306 -p 8888:8888 centos:fund0.3 /sbin/init /bin/bash
查看全部docker实例
docker ps -a
进入docker实例
docker exec -it 94d1611baf33 /bin/bash
查看docker实例信息
docker inspect 94d1611baf33
docker mount 本地目录
docker run --name ubuntu --mount type=bind,source=/root/kafka -dit ubuntu:latest /bin/bash
docker 镜像的save 和 load
docker commit 94d1611baf33 ubuntu:2.0
docker save ubuntu:2.0 -o ubuntu.tar
docker load < ubuntu.tar
docker 实例的export 和 import
docker export f299f501774c > hangger_server.tar
docker import - new_hangger_server < hangger_server.tar
docker 镜像删除
docker rmi mdr_python3:v1
docker 配置代理
vim /usr/lib/systemd/system/docker.service
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
#Environment="HTTP_PROXY=http://10.21.142.20:8080" # 添加这一行
网友评论