栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

docker

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

docker

docker常用命令 源 /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ cosmic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ cosmic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ cosmic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ cosmic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ cosmic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ cosmic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-backports main restricted universe multiverse


sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list

运行
docker run ubuntu:18.04 /bin/echo "Hello world"
docker run -i -t ubuntu:15.10 /bin/bash
docker container prune
docker ps 
docker ps  -a
docker run -d -P training/webapp python app.py
docker run -d -p 5000:5000 training/webapp python app.py
docker port 
docker exec -it 243c32535da7 /bin/bash
image
docker export 1e560fca3906 > ubuntu.tar
cat docker/ubuntu.tar | docker import - test/ubuntu:v1
$ docker import http://example.com/exampleimage.tgz example/imagerepo
docker logs -f bf08b7f2cd89 
docker top wizardly_chandrasekhar
docker commit -m="has update" -a="runoob" e218edb10161 runoob/ubuntu:v2  也可以创建image


#docker commit -m="has update" -a="runoob" e218edb10161   这种默认是latest
#根据当前已有的镜像生成新的
docker tag  sourceImage:tag targetImage:tag
#查看当前容器的信息可以看到用的那个image
docker inspect containerId
#查看image的详情
docker image inspect image
sudo docker login --username=username registry.cn-hangzhou.aliyuncs.com

docker tag ubuntu:18.04 username/ubuntu:18.04
上传到阿里云
https://blog.csdn.net/u010739551/article/details/81536503
https://blog.51cto.com/11342825/2419035

docker commit -m="for aliyun" -a="gaolipeng"  test3  registry.cn-hangzhou.aliyuncs.com/username/ubuntu:18.04 sha256:ef08bb0e5d17bcf93bc9f1e9ae60b96932dcec86e767dd2a23cdfcd9e09d7f6b

docker push registry.cn-hangzhou.aliyuncs.com/username/ubuntu:18.04

杀死运行的容器: docker kill $(docker ps -a -q)
删除所有容器: docker rm $(docker ps -a -q)
强制删除所有镜像: docker rmi -f $(docker images -q)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/450219.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号