diff --git a/Builder/scripts/docker-builder-backend.sh b/Builder/scripts/docker-builder-backend.sh index efe738e..760247a 100755 --- a/Builder/scripts/docker-builder-backend.sh +++ b/Builder/scripts/docker-builder-backend.sh @@ -31,7 +31,7 @@ grep 'FROM code.ornl.gov:4567' ./container.def GREP_RC=$? if [[ ${GREP_RC} -eq 0 ]] ; then echo "Using OLCF Gitlab registry login credentials" - docker login code.ornl.gov:4567 -u ${GITLAB_READONLY_USERNAME} -p ${GITLAB_READONLY_TOKEN} >&${OUT_FD} + docker login code.ornl.gov:4567 -u ${GITLAB_READONLY_USERNAME} -p ${GITLAB_READONLY_TOKEN} 2>&1 >&${OUT_FD} fi # provide read only access to the private olcf dockerhub repository @@ -39,15 +39,15 @@ grep 'FROM olcf/' ./container.def GREP_RC=$? if [[ ${GREP_RC} -eq 0 ]] ; then echo "Using OLCF Dockerhub registry login credentials" - docker login -u ${DOCKERHUB_READONLY_USERNAME} -p ${DOCKERHUB_READONLY_TOKEN} >&${OUT_FD} + docker login -u ${DOCKERHUB_READONLY_USERNAME} -p ${DOCKERHUB_READONLY_TOKEN} 2>&1 >&${OUT_FD} fi # Spin up local registry -docker ${DEBUG_FLAG} run -d -p 5000:5000 --restart=always --name registry registry:2 >&${OUT_FD} +docker ${DEBUG_FLAG} run -d -p 5000:5000 --restart=always --name registry registry:2 2>&1 >&${OUT_FD} # Build the Dockerfile docker image in the current directory mv ./container.def Dockerfile -docker ${DEBUG_FLAG} build -t localhost:5000/docker_image:latest . || { echo 'Build Failed' ; exit 1; } +/usr/bin/unbuffer docker ${DEBUG_FLAG} build -t localhost:5000/docker_image:latest . || { echo 'Build Failed' ; exit 1; } # Push to the local registry docker ${DEBUG_FLAG} push localhost:5000/docker_image:latest &>"$OUT_FD" @@ -56,9 +56,9 @@ docker ${DEBUG_FLAG} push localhost:5000/docker_image:latest &>"$OUT_FD" export SINGULARITY_CACHEDIR=/home/builder/.singularity export SINGULARITY_NOHTTPS=true export SINGULARITY_PULLFOLDER=/home/builder -singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image:latest >&${OUT_FD} +/usr/bin/unbuffer singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image:latest 2>&1 >&${OUT_FD} # Workaround for PULLFOLDER not being respected: https://github.com/singularityware/singularity/pull/855 if [ -e ${SINGULARITY_CACHEDIR}/container.simg ] ; then - mv ${SINGULARITY_CACHEDIR}/container.simg ./container.simg >&${OUT_FD} + mv ${SINGULARITY_CACHEDIR}/container.simg ./container.simg 2>&1 >&${OUT_FD} fi \ No newline at end of file