diff --git a/.azure-pipelines/template/docker-template.yml b/.azure-pipelines/template/docker-template.yml index 1a1a488ca1f..92271529db8 100644 --- a/.azure-pipelines/template/docker-template.yml +++ b/.azure-pipelines/template/docker-template.yml @@ -36,7 +36,6 @@ steps: - ${{ if eq(parameters.dockerConfigName, 'commonDockerConfig') }}: - script: | rm -fr ${BUILD_SOURCESDIRECTORY} || sudo rm -fr ${BUILD_SOURCESDIRECTORY} || true - echo y | docker image prune -a displayName: "Clean workspace" - checkout: self @@ -49,7 +48,6 @@ steps: rm -fr ${BUILD_SOURCESDIRECTORY} || sudo rm -fr ${BUILD_SOURCESDIRECTORY} || true mkdir ${BUILD_SOURCESDIRECTORY} chmod 777 ${BUILD_SOURCESDIRECTORY} - echo y | docker image prune -a displayName: "Clean workspace" - checkout: none @@ -63,6 +61,7 @@ steps: - ${{ if eq(parameters.imageSource, 'build') }}: - script: | + docker image prune -a -f if [[ ! $(docker images | grep -i ${{ parameters.repoName }}:${{ parameters.repoTag }}) ]]; then docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/${{parameters.dockerFileName}}.devel -t ${{ parameters.repoName }}:${{ parameters.repoTag }} . fi