File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 105105# if no Dockerfile is present, use slugbuilder to compile a heroku slug
106106# and write out a Dockerfile to use that slug
107107if [ ! -f Dockerfile ]; then
108+ # FIXME: validate slugs were added correctly to the image
109+ VALIDATE_IMAGE=1
108110 # build option string to send to slugbuilder
109111 BUILD_OPTS=(" $CONFIG " )
110112
@@ -137,6 +139,15 @@ echo "ENV GIT_SHA $GIT_SHA" >> Dockerfile
137139echo
138140puts-step " Building Docker image"
139141docker build -t $TMP_IMAGE . 2>&1
142+
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+
140151puts-step " Pushing image to private registry"
141152docker push $TMP_IMAGE & > /dev/null
142153echo
You can’t perform that action at this time.
0 commit comments