Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing OCI image labels from CNB spec #265

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion heroku-20-cnb-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ RUN groupadd heroku --gid 1000 && \
RUN mkdir /app && \
chown heroku:heroku /app

# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#build-image
ENV CNB_USER_ID=1000
ENV CNB_GROUP_ID=1000
ENV CNB_STACK_ID "heroku-20"
# Note: This image doesn't inherit from the CNB run image variant so we have
# to redeclare the labels present in the CNB run image again here.
LABEL io.buildpacks.base.distro.name="ubuntu"
LABEL io.buildpacks.base.distro.version="20.04"
LABEL io.buildpacks.base.homepage="https://github.com/heroku/base-images"
LABEL io.buildpacks.base.maintainer="Heroku"

# Stack IDs are deprecated, but we still set these for backwards compatibility:
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#iobuildpacksstack-labels
ENV CNB_STACK_ID "heroku-20"
LABEL io.buildpacks.stack.id="heroku-20"

USER heroku
11 changes: 10 additions & 1 deletion heroku-20-cnb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ RUN ln -s /workspace /app
RUN groupadd heroku --gid 1000 && \
useradd heroku -u 1000 -g 1000 -s /bin/bash -m

LABEL io.buildpacks.stack.id="heroku-20"
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#run-image
USER heroku
LABEL io.buildpacks.base.distro.name="ubuntu"
LABEL io.buildpacks.base.distro.version="20.04"
LABEL io.buildpacks.base.homepage="https://github.com/heroku/base-images"
LABEL io.buildpacks.base.maintainer="Heroku"

# Stack IDs are deprecated, but we still set this for backwards compatibility:
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#iobuildpacksstack-labels
LABEL io.buildpacks.stack.id="heroku-20"

ENV HOME /app
11 changes: 10 additions & 1 deletion heroku-22-cnb-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ RUN groupadd heroku --gid 1000 && \
RUN mkdir /app && \
chown heroku:heroku /app

# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#build-image
ENV CNB_USER_ID=1000
ENV CNB_GROUP_ID=1000
ENV CNB_STACK_ID "heroku-22"
# Note: This image doesn't inherit from the CNB run image variant so we have
# to redeclare the labels present in the CNB run image again here.
LABEL io.buildpacks.base.distro.name="ubuntu"
LABEL io.buildpacks.base.distro.version="22.04"
LABEL io.buildpacks.base.homepage="https://github.com/heroku/base-images"
LABEL io.buildpacks.base.maintainer="Heroku"

# Stack IDs are deprecated, but we still set these for backwards compatibility:
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#iobuildpacksstack-labels
ENV CNB_STACK_ID "heroku-22"
LABEL io.buildpacks.stack.id="heroku-22"

USER heroku
11 changes: 10 additions & 1 deletion heroku-22-cnb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ RUN ln -s /workspace /app
RUN groupadd heroku --gid 1000 && \
useradd heroku -u 1000 -g 1000 -s /bin/bash -m

LABEL io.buildpacks.stack.id="heroku-22"
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#run-image
USER heroku
LABEL io.buildpacks.base.distro.name="ubuntu"
LABEL io.buildpacks.base.distro.version="22.04"
LABEL io.buildpacks.base.homepage="https://github.com/heroku/base-images"
LABEL io.buildpacks.base.maintainer="Heroku"

# Stack IDs are deprecated, but we still set this for backwards compatibility:
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#iobuildpacksstack-labels
LABEL io.buildpacks.stack.id="heroku-22"

ENV HOME /app
6 changes: 5 additions & 1 deletion heroku-24-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ FROM $BASE_IMAGE
USER root
RUN --mount=target=/build /build/setup.sh

# https://github.com/buildpacks/spec/blob/main/platform.md#build-image
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#build-image
# The `io.buildpacks.base.*` labels are inherited from the run image, so don't need to be repeated here.
USER 1002
ENV CNB_USER_ID=1002
ENV CNB_GROUP_ID=1000

# Stack IDs are deprecated, but we still set this for backwards compatibility:
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#iobuildpacksstack-labels
ENV CNB_STACK_ID "heroku-24"
9 changes: 8 additions & 1 deletion heroku-24/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
FROM ubuntu:24.04
RUN --mount=target=/build /build/setup.sh

# https://github.com/buildpacks/spec/blob/main/platform.md#run-image
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#run-image
USER 1001
LABEL io.buildpacks.base.distro.name="ubuntu"
LABEL io.buildpacks.base.distro.version="24.04"
LABEL io.buildpacks.base.homepage="https://github.com/heroku/base-images"
LABEL io.buildpacks.base.maintainer="Heroku"

# Stack IDs are deprecated, but we still set this for backwards compatibility:
# https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#iobuildpacksstack-labels
LABEL io.buildpacks.stack.id="heroku-24"