Skip to content

Commit

Permalink
add cleanup, add docker login to user jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinab25 authored May 7, 2021
1 parent 5d73dd2 commit 8b05403
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker-entrypoint-dind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ if [ -n "$DOCKERHUB_USER" ] && [ -n "$DOCKERHUB_PASS" ]; then
gosu jenkins mkdir $HOME/.m2
gosu jenkins j2 "$SETTINGS_TPL" > $SETTINGS_FILE
docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASS
mkdir -p /var/jenkins_home/worker/.docker
cp /root/.docker/config.json /var/jenkins_home/worker/.docker/config.json
chown -R jenkins:jenkins /var/jenkins_home/worker/.docker
fi

#clean up workspace
rm -rf /var/jenkins_home/worker/workspace/*

exec /docker-entrypoint.sh "$@"

0 comments on commit 8b05403

Please sign in to comment.