Skip to content

Commit c40d6fa

Browse files
committed
Make the build step fail when the curl operation fails.
Without the pipefail, the step always succeeds and the layer gets cached, resulting in confusion during the next step failing and subsequent rebuild attempt.
1 parent a5f7795 commit c40d6fa

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

docker/release/centos7/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ RUN yum install -y \
3535
&& yum clean all
3636

3737
# Download and configure Microsoft Repository config file
38-
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
38+
RUN set -o pipefail \
39+
&& curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
3940

4041
# Install latest powershell from Microsoft YUM Repo
4142
RUN yum install -y \

docker/release/fedora26/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ ENV LC_ALL $LANG
3636
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG
3737

3838
# Download and configure Microsoft Repository config file
39-
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
39+
RUN set -o pipefail \
40+
&& curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
4041

4142
# Install latest powershell from Microsoft YUM Repo
4243
RUN dnf install -y powershell-${POWERSHELL_VERSION} \

docker/release/fedora27/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ ENV LC_ALL $LANG
3737
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG
3838

3939
# Download and configure Microsoft Repository config file
40-
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
40+
RUN set -o pipefail \
41+
&& curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
4142

4243
# Install latest powershell from Microsoft YUM Repo
4344
RUN dnf install -y powershell-${POWERSHELL_VERSION}} \

docker/release/ubuntu14.04/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ RUN apt-get update \
4444
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
4545

4646
# Register the Microsoft Ubuntu 14.04 repository
47-
RUN curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
47+
RUN set -o pipefail \
48+
&& curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
4849

4950
# Install powershell from Microsoft Repo
5051
RUN apt-get update \

docker/release/ubuntu16.04/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ RUN locale-gen $LANG && update-locale
4545
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
4646

4747
# Register the Microsoft Ubuntu 16.04 repository
48-
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
48+
RUN set -o pipefail \
49+
&& curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
4950

5051
# Install powershell from Microsoft Repo
5152
RUN apt-get update \

0 commit comments

Comments
 (0)