Why do I need an Nginx or Apache server for my docker repository?

The reason you need either Nginx or Apache (or other reverse proxy) when working with a Docker repository is due to the way that Docker interfaces with its repositories. Docker requires the URL of any repository it connects to conform to a specific format:

 

http(s)://<host>:<port>/v2

 

Similarly Artifactory requires a specific URL format:

 

http://<host>:<port>/artifactory/api/docker/<docker_repository>

 

These URLs are incompatible with each other so some transforming/redirection must take place.

 

Nginx or Apache are used to do this redirection as covered in the Docker documentation. Your load-balancer should be able to do the same sort of thing.