Skip to content

Commit

Permalink
Use --password-stdin instead of -p for docker hub auth
Browse files Browse the repository at this point in the history
  • Loading branch information
edannenberg committed Feb 1, 2019
1 parent b60126f commit 0fb5c3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion cmd/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ function main() {
expand_image_id "${image_id}" "${_IMAGE_PATH}"
# shellcheck disable=SC2154
source_image_conf "${__expand_image_id}"
source_push_conf "${image_id}"
get_ns_dir_by_image_path "${__expand_image_id}"
# shellcheck disable=SC2154
source_push_conf "${__get_ns_dir_by_image_path}"

if ! image_exists "${image_id}"; then
add_status_value "${image_id}"
Expand Down
6 changes: 4 additions & 2 deletions engine/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,11 @@ function push_auth() {
login_args=('-u' "${DOCKER_LOGIN}")
# shellcheck disable=SC2153
if [[ -n "${DOCKER_PW}" ]]; then
login_args+=('-p' "${DOCKER_PW}")
login_args+=( '--password-stdin' )
echo "${DOCKER_PW}" | "${DOCKER}" login "${login_args[@]}" || exit 1
else
"${DOCKER}" login "${login_args[@]}" || exit 1
fi
"${DOCKER}" login "${login_args[@]}" || exit 1
else
msg_info "using ${repository_url}"
fi
Expand Down
12 changes: 6 additions & 6 deletions lib/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ function source_image_conf() {
# Read namespace push.conf for given image_id
#
# Arguments:
# 1: image_id (i.e. kubler/busybox)
# 1: namespace_path - absolute
function source_push_conf() {
local namespace
namespace="${1%%/*}"
local namespace_path
namespace_path="$1"
# exit if we just sourced for this NS
[[ "${_last_sourced_push_conf}" == "${namespace}" ]] && return 0
[[ "${_last_sourced_push_conf}" == "${namespace_path}" ]] && return 0
# shellcheck disable=SC1090
[[ -f "${namespace}/push.conf" ]] && source "${namespace}/push.conf"
_last_sourced_push_conf="${namespace}"
[[ -f "${namespace_path}/push.conf" ]] && source "${namespace_path}/push.conf"
_last_sourced_push_conf="${namespace_path}"
}

# Check image dependencies and return base build container id for given image_id. Recursive.
Expand Down

0 comments on commit 0fb5c3e

Please sign in to comment.