Skip to content

Commit 16c3388

Browse files
committed
Merge pull request #2362 from mboersma/catch-build-sh-errors
fix(build.sh): fail on errors in Dockerfile two-tier builds
2 parents 68aa294 + 833bfd7 commit 16c3388

6 files changed

Lines changed: 32 additions & 13 deletions

File tree

cache/image/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the cache locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

controller/build.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
47
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the controller locally"
@@ -13,7 +16,7 @@ DEBIAN_FRONTEND=noninteractive
1316
# HACK: install git so we can install bacongobbler's fork of django-fsm
1417
# install openssh-client for temporary fleetctl wrapper
1518
apt-get update && \
16-
apt-get install -yq python-dev libpq-dev libyaml-dev git
19+
apt-get install -yq python-dev libffi-dev libpq-dev libyaml-dev git
1720

1821
# install pip
1922
curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
@@ -32,8 +35,8 @@ mkdir -p /templates && chown -R deis:deis /templates
3235
pip install -r /app/requirements.txt
3336

3437
# cleanup. indicate that python, libpq and libyanl are required packages.
35-
apt-mark unmarkauto python python-openssl libpq5 libpython2.7 libyaml-0-2 && \
36-
apt-get remove -y --purge python-dev gcc cpp libpq-dev libyaml-dev git && \
38+
apt-mark unmarkauto python python-openssl libpq5 libpython2.7 libffi6 libyaml-0-2 && \
39+
apt-get remove -y --purge python-dev gcc cpp libffi-dev libpq-dev libyaml-dev git && \
3740
apt-get autoremove -y --purge && \
3841
apt-get clean -y && \
3942
rm -Rf /usr/share/man /usr/share/doc && \

database/build.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the database locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

@@ -49,4 +52,4 @@ apt-mark unmarkauto python curl daemontools file libxml2-dev \
4952
apt-get clean -y && \
5053
rm -Rf /usr/share/man /usr/share/doc && \
5154
rm -rf /tmp/* /var/tmp/* && \
52-
rm -rf /var/lib/apt/lists/*
55+
rm -rf /var/lib/apt/lists/*

registry/build.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the registry locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

@@ -12,7 +15,8 @@ DEBIAN_FRONTEND=noninteractive
1215
sed -i 's/main$/main universe/' /etc/apt/sources.list
1316

1417
# install required packages (copied from dotcloud/docker-registry Dockerfile)
15-
apt-get install -y git-core build-essential python-dev \
18+
apt-get update && \
19+
apt-get install -y git-core build-essential python-dev \
1620
libevent-dev python-openssl liblzma-dev
1721

1822
# install pip

router/parent/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
47
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the router locally"

store/base/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the controller locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

0 commit comments

Comments
 (0)