DOCKER 指令
Posted love-feng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DOCKER 指令相关的知识,希望对你有一定的参考价值。
私有Docker Registry的部署和配置
1 docker pull registry //获取registry镜像文件
2
3 docker images //查看本地的registry镜像文件
4 REPOSITORY TAG IMAGE ID CREATED SIZE
5 registry latest 047218491f8c 4 days ago 33.17 MB
6
7 docker run -d -p 5000:5000 --restart=always --name registry registry:latest //运行一个registry的容器
配置docker中的josn文件信息:
[root@localhost /]# cd /etc/docker
[root@localhost docker]# ls
daemon.json key.json
[root@localhost docker]# cat daemon.json
{
"registry-mirrors": ["https://apg1cbea.mirror.aliyuncs.com"],
"insecure-registries":["192.168.1.5:5000"]
}
[root@localhost docker]#
[root@localhost docker]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@localhost docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 5.6 0248eeb807c7 2 weeks ago 256MB
registry latest d1fd7d86a825 2 months ago 33.3MB
tomcat 8.5 3dcfe809147d 3 months ago 557MB
[root@localhost docker]# docker pull 192.168.1.5:5000/ipms
[root@localhost docker]# docker tag 192.168.1.5:5000/ipms registry.kcsm.com/ipms
在docker-compose中创建相应的配置文件:
[root@localhost usr]# mkdir kcsm
[root@localhost usr]# cd kcsm/
[root@localhost kcsm]# ls
[root@localhost kcsm]# mkdir docker-compose/ipp
mkdir: 无法创建目录"docker-compose/ipp": 没有那个文件或目录
[root@localhost kcsm]# mkdir docker-compose
[root@localhost kcsm]# cd docker-compose/
[root@localhost docker-compose]# ls
[root@localhost docker-compose]# mkdir ipp
[root@localhost docker-compose]# cd ipp/
[root@localhost ipp]# ls
[root@localhost ipp]# ls
docker-compose.yml
[root@localhost ipp]# docker images
以上是关于DOCKER 指令的主要内容,如果未能解决你的问题,请参考以下文章