From ebc7cdf847ef39c8d71fd0f69849bf59f498111b Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Mon, 4 Jun 2018 22:18:07 +0200 Subject: [PATCH] Make the build step fail when the curl operation fails. (#6961) Without the pipefail, the step always succeeds and the layer gets cached, resulting in confusion during the next step failing and subsequent rebuild attempt. --- docker/release/centos7/Dockerfile | 3 ++- docker/release/fedora26/Dockerfile | 3 ++- docker/release/fedora27/Dockerfile | 3 ++- docker/release/ubuntu14.04/Dockerfile | 3 ++- docker/release/ubuntu16.04/Dockerfile | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docker/release/centos7/Dockerfile b/docker/release/centos7/Dockerfile index ba824ba25a..8c2db16b38 100644 --- a/docker/release/centos7/Dockerfile +++ b/docker/release/centos7/Dockerfile @@ -35,7 +35,8 @@ RUN yum install -y \ && yum clean all # Download and configure Microsoft Repository config file -RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo +RUN set -o pipefail \ + && curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo # Install latest powershell from Microsoft YUM Repo RUN yum install -y \ diff --git a/docker/release/fedora26/Dockerfile b/docker/release/fedora26/Dockerfile index 4158aecb57..e240d76475 100644 --- a/docker/release/fedora26/Dockerfile +++ b/docker/release/fedora26/Dockerfile @@ -36,7 +36,8 @@ ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG # Download and configure Microsoft Repository config file -RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo +RUN set -o pipefail \ + && curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo # Install latest powershell from Microsoft YUM Repo RUN dnf install -y powershell-${POWERSHELL_VERSION} \ diff --git a/docker/release/fedora27/Dockerfile b/docker/release/fedora27/Dockerfile index a67e2b11cb..46d36f4781 100644 --- a/docker/release/fedora27/Dockerfile +++ b/docker/release/fedora27/Dockerfile @@ -37,7 +37,8 @@ ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG # Download and configure Microsoft Repository config file -RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo +RUN set -o pipefail \ + && curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo # Install latest powershell from Microsoft YUM Repo RUN dnf install -y powershell-${POWERSHELL_VERSION} \ diff --git a/docker/release/ubuntu14.04/Dockerfile b/docker/release/ubuntu14.04/Dockerfile index 2b1e6a5e59..f762116984 100644 --- a/docker/release/ubuntu14.04/Dockerfile +++ b/docker/release/ubuntu14.04/Dockerfile @@ -44,7 +44,8 @@ RUN apt-get update \ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - # Register the Microsoft Ubuntu 14.04 repository -RUN curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list +RUN set -o pipefail \ + && curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list # Install powershell from Microsoft Repo RUN apt-get update \ diff --git a/docker/release/ubuntu16.04/Dockerfile b/docker/release/ubuntu16.04/Dockerfile index b28771f268..4870e27e8e 100644 --- a/docker/release/ubuntu16.04/Dockerfile +++ b/docker/release/ubuntu16.04/Dockerfile @@ -45,7 +45,8 @@ RUN locale-gen $LANG && update-locale RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - # Register the Microsoft Ubuntu 16.04 repository -RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list +RUN set -o pipefail \ + && curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list # Install powershell from Microsoft Repo RUN apt-get update \