Skip to content

Commit

Permalink
Fixes tags:deploy command for images that contain ONBUILD directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Cellane authored and josegonzalez committed Dec 12, 2020
1 parent de0a467 commit a42786a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/builder-dockerfile/builder-release
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ trigger-builder-dockerfile-builder-release() {
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"

local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
if "$DOCKER_BIN" image history --format "{{ json . }}" "$IMAGE" | grep -q "ONBUILD"; then
dokku_log_warn "Image contains ONBUILD directive(s), skipping re-labeling"
else
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
fi
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
}

Expand Down

0 comments on commit a42786a

Please sign in to comment.