From 8b054035ca44ccf562520bce0d896aff3c975ef7 Mon Sep 17 00:00:00 2001 From: valentinab25 <30239069+valentinab25@users.noreply.github.com> Date: Fri, 7 May 2021 20:08:48 +0300 Subject: [PATCH] add cleanup, add docker login to user jenkins --- docker-entrypoint-dind.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-entrypoint-dind.sh b/docker-entrypoint-dind.sh index 6359ecb..9ef1738 100755 --- a/docker-entrypoint-dind.sh +++ b/docker-entrypoint-dind.sh @@ -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 "$@"