Skip to content

Commit

Permalink
add username and password options to docker login (#37)
Browse files Browse the repository at this point in the history
* add username and password options to docker login

* changed docker pass to docker password

Changed it in all instances

* removed old docker login
  • Loading branch information
sabuto authored and pvizeli committed Dec 6, 2019
1 parent 27f352b commit 03fcfd0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ DOCKER_HUB_CHECK=false
DOCKER_CACHE=true
DOCKER_LATEST=true
DOCKER_PUSH=true
DOCKER_LOGIN=false
DOCKER_USER=
DOCKER_PASSWORD=
DOCKER_LOCAL=false
CROSSBUILD_CLEANUP=true
SELF_CACHE=false
Expand Down Expand Up @@ -105,8 +106,10 @@ Options:
Set or overwrite the docker repository.
--docker-hub-check
Check if the version already exists before starting the build.
--docker-login
Login into docker hub on startup (need '-ti' docker opts)
--docker-user
Username to login into docker with
--docker-password
Password to login into docker with
--no-crossbuild-cleanup
Don't cleanup the crosscompile feature (for multible builds)
Expand Down Expand Up @@ -828,9 +831,12 @@ while [[ $# -gt 0 ]]; do
--docker-hub-check)
DOCKER_HUB_CHECK=true
;;
--docker-login)
DOCKER_LOGIN=true
;;
--docker-user)
DOCKER_USER=$2
;;
--docker-password)
DOCKER_PASSWORD=$2
;;
--no-crossbuild-cleanup)
CROSSBUILD_CLEANUP=false
;;
Expand Down Expand Up @@ -967,8 +973,8 @@ init_crosscompile
start_docker

# Login into dockerhub
if [ "$DOCKER_LOGIN" == "true" ]; then
docker login
if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_PASSWORD" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
fi

# Load external repository
Expand Down

0 comments on commit 03fcfd0

Please sign in to comment.