Gitlab registry and upload problems which Apache as proxy
I use Gitlab CE already for quite a while and started with integrated CI recently. I really love the ability to run tests automatically and see the results…
My new Perl project uses some modules from CPAN, well, more or less every project does, and I started using Dist::Zilla. This is a different story to tell…
However, with Dist::Zilla I’m now able to get all dependencies and test my project properly. What else do I need, yes, a docker container besides a nice .gitlab-ci.yml
file.
After some runs I wanted to use my very own Docker image, because downloading perlbrew and different Perl version and Dist::Zilla every time seemed a waste of time and resources for me.
The Dockerfile was in place quickly, the registry setup following the documentation. The only difference is that I use an Apache server as reverse proxy that is running on that machine anyway.
For the Apache configuration I followed Issue 50: Document how to use Docker Registry with apache.
Everything seemed to work fine until I wanted to upload my newly created image file.
I always got retries all the time and error messages about <pre>dockerd Upload failed, retrying: EOF</pre>
Searching the web didn’t reveal anything useful.
After a while I changed my Apache configuration following the Docker Registry example.
It doesn’t fit perfectly, but I used it as a template. So what now works for me is the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
ServerName registry.example.com
ServerSignature Off
RequestHeader set X-Forwarded-Proto "https"
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
<Location />
Order deny,allow
Allow from all
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined