-
-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Docker run option to inlcude credentials for private remote reg… #87
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,11 +10,20 @@ fi | |
|
||
if [ -n "${REGISTRY_URL}" ] ; then | ||
sed -i "s,\${REGISTRY_URL},${REGISTRY_URL}," /etc/nginx/conf.d/default.conf | ||
HOST=$(echo ${REGISTRY_URL} | sed "s,http[s]*://,,") | ||
sed -i "s,\${HOST},${HOST}," /etc/nginx/conf.d/default.conf | ||
sed -i "s,#!,," /etc/nginx/conf.d/default.conf | ||
|
||
if [ -f ${CREDS_FILE} ] ; then | ||
CREDENTIALS=$(cat ${CREDS_FILE} | tr -d \\n) | ||
BASIC_AUTH=$(echo -n "${CREDENTIALS}" | base64 | tr -d \\n) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks better yes 😄 but I found a more generic way, a feature to add any header in the proxy pass |
||
sed -i "s,\${BASIC_AUTH},${BASIC_AUTH}," /etc/nginx/conf.d/default.conf | ||
sed -i "s,##,," /etc/nginx/conf.d/default.conf | ||
fi | ||
fi | ||
|
||
if [ -z "$@" ]; then | ||
nginx -g "daemon off;" | ||
else | ||
$@ | ||
fi | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ server { | |
#! return 404; | ||
#! } | ||
#! proxy_pass ${REGISTRY_URL}; | ||
#! proxy_set_header Host ${HOST}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is out of the scope and has been fixed with 1321d9b |
||
## # Allow for authentication for access to backend registry | ||
## proxy_set_header Authorization "Basic ${BASIC_AUTH}"; | ||
#! } | ||
|
||
#error_page 404 /404.html; | ||
|
@@ -42,4 +45,4 @@ server { | |
#location ~ /\.ht { | ||
# deny all; | ||
#} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a brilliant idea to improve the security!