Skip to content

Commit 7e658c4

Browse files
author
Gabriel Monroy
committed
fix(builder): work around 0-byte ADD layer by ignoring tar timestamps
1 parent 0247123 commit 7e658c4

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

builder/templates/builder

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ TMP_DIR=$(mktemp -d --tmpdir=$BUILD_DIR)
7171

7272
cd $REPO_DIR
7373
# extract git branch
74-
git archive $BRANCH | tar -xC $TMP_DIR
74+
git archive $BRANCH | tar -xmC $TMP_DIR
7575

7676
# switch to app context
7777
cd $TMP_DIR
@@ -105,8 +105,7 @@ fi
105105
# if no Dockerfile is present, use slugbuilder to compile a heroku slug
106106
# and write out a Dockerfile to use that slug
107107
if [ ! -f Dockerfile ]; then
108-
# FIXME: validate slugs were added correctly to the image
109-
VALIDATE_IMAGE=1
108+
110109
# build option string to send to slugbuilder
111110
BUILD_OPTS=("$CONFIG")
112111

@@ -140,14 +139,6 @@ echo
140139
puts-step "Building Docker image"
141140
docker build -t $TMP_IMAGE . 2>&1
142141

143-
# FIXME: validate Docker image to ensure slug is not malformed
144-
if [[ $VALIDATE_IMAGE ]]; then
145-
if [[ "$(docker history $TMP_IMAGE | grep ADD | head -n1 | awk {'print $11'})" == "0" ]]; then
146-
puts-warn "Malformed Docker image, aborting build."
147-
exit 1
148-
fi
149-
fi
150-
151142
puts-step "Pushing image to private registry"
152143
docker push $TMP_IMAGE &>/dev/null
153144
echo

0 commit comments

Comments
 (0)