Unable to push image
joshiparth1000 opened this issue · comments
Hi,
I have setup the registry-ui and registry itself using the below docker-compose.yml file:
version: '2'
services:
registry-srv:
image: registry:latest
restart: always
#ports:
# - 5000:5000
volumes:
- storage:/var/lib/registry
- ./registry/config.yml:/etc/docker/registry/config.yml:ro
networks:
- registry-ui-net
container_name: registry-srv
registry-ui:
image: joxit/docker-registry-ui:static
restart: always
ports:
- 8080:80
environment:
- REGISTRY_TITLE=Private Docker Registry
- REGISTRY_URL=http://registry-srv:5000
- DELETE_IMAGES=true
depends_on:
- registry-srv
networks:
- registry-ui-net
container_name: registry-ui
networks:
registry-ui-net:
volumes:
storage:
driver: local
my registry config.yml is as below:
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
delete:
enabled: true
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
Access-Control-Allow-Origin: ['*']
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
Access-Control-Expose-Headers: ['Docker-Content-Digest']
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
The registry-ui is configured as a reverse proxy for the registry container. I can see that it is working correctly:
curl http://localhost:8080/v2/_catalog
{"repositories":[]}
The registry-ui also has been added as in insecure registry in the docker config.
cat /etc/docker/daemon.json
{
"insecure-registries" : ["127.0.0.1:8080"]
}
But even after doing this I am unable to push images to this local registry. I get retrying message when pushing images:
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
joxit/docker-registry-ui static e247d643a5da 11 days ago 21.3MB
127.0.0.1:8080/registry latest f32a97de94e1 3 months ago 25.8MB
registry latest f32a97de94e1 3 months ago 25.8MB
docker push 127.0.0.1:8080/registry
The push refers to repository [127.0.0.1:8080/registry]
73d61bf022fd: Pushing [==================================================>] 155B/155B
5bbc5831d696: Pushing [==================================================>] 3.584kB
d5974ddb5a45: Retrying in 1 second
f641ef7a37ad: Retrying in 1 second
d9ff549177a9: Retrying in 1 second
dial tcp 127.0.0.1:80: connect: connection refused
Could you please help out and let me know what I am doing wrong here?
Hi,
That's really weird, I tried you configuration and when I change the port to 80
instead of 8080
it works... Can you try the port 80 and tell me if it works?
Hi,
Yes after changing the port to 80 it does work.
Okay
I'll try to find why this doesn't work with 8080 port, this may be linked to the protocol between the docker client and the registry.
I see this message dial tcp 127.0.0.1:80: connect: connection refused
when the contact point is 127.0.0.1:8080. Maybe this is a registry misconfiguration.
Can I close the issue or you would like to have your ui on 8080 port?
Hi
Good news, I fixed this issue ! I also add an example here.
This should works for you now.
Thank you again for your issue ! 👍