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文件信息:
[ /]# cd /etc/docker
[ docker]# ls
daemon.json key.json
[ docker]# cat daemon.json
{
"registry-mirrors": ["https://apg1cbea.mirror.aliyuncs.com"],
"insecure-registries":["192.168.1.5:5000"]
}
[ docker]#
[ docker]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[ 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
[ docker]# docker pull 192.168.1.5:5000/ipms
[ docker]# docker tag 192.168.1.5:5000/ipms registry.kcsm.com/ipms
在docker-compose中创建相应的配置文件:
[ usr]# mkdir kcsm
[ usr]# cd kcsm/
[ kcsm]# ls
[ kcsm]# mkdir docker-compose/ipp
mkdir: 无法创建目录"docker-compose/ipp": 没有那个文件或目录
[ kcsm]# mkdir docker-compose
[ kcsm]# cd docker-compose/
[localhost docker-compose]# ls
[ docker-compose]# mkdir ipp
[ docker-compose]# cd ipp/
[ ipp]# ls
[ ipp]# ls
docker-compose.yml
[ ipp]# docker images