前端框架选型是企业提升开发效率与用户体验的关键因素
700
2022-08-31
Docker容器进阶
一、Docker私有仓库
1、仓库镜像
Docker hub官方已提供容器镜像registry,用于搭建私有仓库
拉取镜像
[root@docker ~]# docker pull daocloud.io/library/registry:latest
2、运行容器
[root@docker ~]# docker run --name "pri_registry" --restart=always -d -p 5000:5000 daocloud.io/library/registryabdd5dd0c05b372dbd06899319e6747f4af2f6a332fc6e09049fe84951365e02
3、查看容器
[root@docker ~]# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESabdd5dd0c05b daocloud.io/library/registry "/entrypoint.sh /etc…" 20 minutes ago Up 8 minutes 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp pri_registry
4、连接容器查看端口状态
[root@docker ~]# docker exec -it abdd /bin/sh/ # netstat -auntpl | grep 5000tcp 0 0 :::5000 :::* LISTEN 1/registry/ # netstat -lnpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 :::5000 :::* LISTEN 1/registryActive UNIX domain sockets (only servers)Proto RefCnt Flags Type State I-Node PID/Program name Path[root@docker ~]# curl -I 127.0.0.1:5000HTTP/1.1 200 OKCache-Control: no-cacheDate: Sat, 06 Aug 2022 12:52:02 GMT
5、仓库功能测试
[root@docker ~]# docker pull busyboxUsing default tag: latestlatest: Pulling from library/busyboxDigest: sha256:ef320ff10026a50cf5f0213d35537ce0041ac1d96e9b7800bafd8bc9eff6c693Status: Image is up to date for busybox:latestdocker.io/library/busybox:latest#给镜像打tag[root@docker ~]# docker tag busybox 192.168.10.11:5000/busybox:v1[root@docker ~]# vim /etc/docker/daemon.json{ "insecure-registries":["192.168.10.11:5000"]}[root@docker ~]# systemctl restart docker#上传镜像到私有仓库[root@docker ~]# docker push 192.168.10.11:5000/busybox:v1 [root@docker ~]# docker rmi 192.168.10.11:5000/busybox:v1#从私有仓库-镜像[root@docker ~]# docker pull 192.168.10.11:5000/busybox:v1[root@docker ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE192.168.10.11:5000/busybox v1 7a80323521cc 7 days ago 1.24MB
二、部署Docker-WebUI
1、-并运行容器
[root@docker ~]# docker pull uifd/ui-for-docker [root@docker ~]# docker imagesuifd/ui-for-docker latest 965940f98fa5 5 years ago 8.1MB[root@docker ~]# docker run -it -d --name docker-web -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock docker.io/uifd/ui-for-docker
2、浏览器访问测试
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~