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.
This commit is contained in:
Jan Pazdziora 2018-06-04 22:18:07 +02:00 committed by Travis Plunk
parent d663b41bd5
commit ebc7cdf847
5 changed files with 10 additions and 5 deletions

View file

@ -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 \

View file

@ -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} \

View file

@ -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} \

View file

@ -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 \

View file

@ -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 \