Just use the current server as the registry server, this will work for all externally available addresses.

This commit is contained in:
yackob03 2013-10-29 16:11:54 -04:00
parent 6f105326aa
commit 78d6c9d9a3
2 changed files with 4 additions and 4 deletions

View file

@ -2,6 +2,7 @@ import json
import urllib
import json
import logging
import urlparse
from flask import request, make_response, jsonify, abort
from functools import wraps
@ -25,7 +26,9 @@ def generate_headers(role='read'):
def wrapper(namespace, repository, *args, **kwargs):
response = f(namespace, repository, *args, **kwargs)
response.headers['X-Docker-Endpoints'] = app.config['REGISTRY_SERVER']
# We run our index and registry on the same hosts for now
registry_server = urlparse.urlparse(request.url).netloc
response.headers['X-Docker-Endpoints'] = registry_server
has_token_request = request.headers.get('X-Docker-Token', '')