-
Notifications
You must be signed in to change notification settings - Fork 258
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_config_json parameter #317
base: master
Are you sure you want to change the base?
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 |
---|---|---|
|
@@ -2,6 +2,9 @@ LOG_FILE=${LOG_FILE:-/tmp/docker.log} | |
SKIP_PRIVILEGED=${SKIP_PRIVILEGED:-false} | ||
STARTUP_TIMEOUT=${STARTUP_TIMEOUT:-120} | ||
|
||
# Otherwise we get "certificate relies on legacy Common Name field" | ||
export GODEBUG="x509ignoreCN=0" | ||
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. In what user case that you need this env var? Are you seeing the error when check/in/out? From what I understand in this resource, only the check cmd is using Go, so in/out that uses bash script should not be affected? |
||
|
||
sanitize_cgroups() { | ||
mkdir -p /sys/fs/cgroup | ||
mountpoint -q /sys/fs/cgroup || \ | ||
|
@@ -206,3 +209,9 @@ docker_pull() { | |
printf "\n${RED}Failed to pull image %s.${NC}" "$1" | ||
return 1 | ||
} | ||
|
||
docker_config_json_to_file() { | ||
local docker_config_json="${1}" | ||
mkdir -p ~/.docker | ||
echo "${1}" > ~/.docker/config.json | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ registry_mirror=$(jq -r '.source.registry_mirror // ""' < $payload) | |
|
||
username=$(jq -r '.source.username // ""' < $payload) | ||
password=$(jq -r '.source.password // ""' < $payload) | ||
docker_config_json=$(jq -r '.source.docker_config_json // ""' < $payload) | ||
repository=$(jq -r '.source.repository // ""' < $payload) | ||
ca_certs=$(jq -r '.source.ca_certs // []' < $payload) | ||
client_certs=$(jq -r '.source.client_certs // []' < $payload) | ||
|
@@ -52,7 +53,12 @@ start_docker \ | |
"${max_concurrent_uploads}" \ | ||
"$insecure_registries" \ | ||
"$registry_mirror" | ||
log_in "$username" "$password" "$registry" | ||
|
||
if [ -z "$docker_config_json" ]; then | ||
log_in "$username" "$password" "$registry" | ||
else | ||
docker_config_json_to_file "$docker_config_json" | ||
fi | ||
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. Could you add an out test to cover this feature? |
||
|
||
tag_source=$(jq -r '.source.tag // "latest"' < $payload) | ||
tag_params=$(jq -r '.params.tag_file // ""' < $payload) | ||
|
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.