docker pull registry
docker run -itd -v /registry/data(数据存放的路径):registry/registry(镜像存放路径)-p 8080:5000 registry
检查仓库运行状态:http://localhost:8080/v2
请求成功则是运行状态
docker pull ubuntu
docker tag ubuntu:latest localhost:8080/ubuntu:v0.1 ( ip:8080/ubuntu:v0.1 执行IP方法需要配置)
docker push localhost:8080/ubuntu:v0.1 (ip:8080/ubuntu:v0.1)
docker pull localhost:8080/ubuntu:v0.1 (ip:8080/ubuntu:v0.1)
FQA:
1、执行以下命令需要先配置daedemo.json
{
"features": {
"buildkit": true
},
"insecure-registries": [
"192.168.0.101:8080"
],
"experimental": false,
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "20GB"
}
}
}
2、docker push received unexpected HTTP status: 503 Service Unavailable
有2种情况:
1、是私有本地仓库在同局域网,查看服务是否启动,一般是没有启动
2、可能需要证书:docker run -d \
-p 8080:5000 \
-v /usr/local/registry:/var/lib/registry \
-v /usr/local/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/server.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/server.key \
--restart=always \
--name registry \
registry