Skip to content

Commit f08a2aa

Browse files
authored
feat: include standard OCI annotations on published images (#54)
For example: ``` "org.opencontainers.image.title=PaperMC Server", "org.opencontainers.image.description=Dockerized and fine-grained customizable PaperMC server.", "org.opencontainers.image.version=1.21.4-v1.0.0-20250407", "org.opencontainers.image.url=https://github.com/Djaytan/docker-papermc-server", "org.opencontainers.image.documentation=https://github.com/Djaytan/docker-papermc-server", "org.opencontainers.image.source=https://github.com/Djaytan/docker-papermc-server.git", "org.opencontainers.image.authors=Djaytan \u003chttps://github.com/Djaytan\u003e", "org.opencontainers.image.vendor=Djaytan", "org.opencontainers.image.licenses=GPL-3.0-or-later", "org.opencontainers.image.created=2025-04-07T21:41:44Z", "org.opencontainers.image.revision=e0f3d523b9c670409e04225b737a838f0391d8b7" ```
1 parent 16fa01b commit f08a2aa

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,6 @@ jobs:
8888
env:
8989
GITHUB_TOKEN: ${{ github.token }}
9090
ROOT_PROJECT_DIR: ${{ github.workspace }}
91+
REVISION: ${{ github.sha }}
9192
working-directory: .github/semantic-release/
9293
run: npx --no-install semantic-release

src/main/docker-bake.hcl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ variable "IMAGE_NAME" {
88
# TODO: make organization configurable
99
default = "djaytan/papermc-server"
1010
}
11+
variable "REVISION" {
12+
default = ""
13+
}
1114

1215
# Tags properties
1316
variable "IS_LATEST_RELEASE" {
@@ -72,6 +75,17 @@ target "release" {
7275
tag("${MINECRAFT_VERSION}-v${extractMajorMinorFromSemVer(IMAGE_VERSION)}"),
7376
tag("${MINECRAFT_VERSION}-v${extractMajorFromSemVer(IMAGE_VERSION)}")
7477
]
75-
# TODO: annotations => https://github.com/opencontainers/image-spec/blob/main/annotations.md (or at Dockerfile level maybe?)
76-
# TODO: what about labels?
78+
annotations = [
79+
"org.opencontainers.image.title=PaperMC Server",
80+
"org.opencontainers.image.description=Dockerized and fine-grained customizable PaperMC server.",
81+
"org.opencontainers.image.version=${MINECRAFT_VERSION}-v${IMAGE_VERSION}-${date()}",
82+
"org.opencontainers.image.url=https://github.com/Djaytan/docker-papermc-server",
83+
"org.opencontainers.image.documentation=https://github.com/Djaytan/docker-papermc-server",
84+
"org.opencontainers.image.source=https://github.com/Djaytan/docker-papermc-server.git",
85+
"org.opencontainers.image.authors=Djaytan <https://github.com/Djaytan>",
86+
"org.opencontainers.image.vendor=Djaytan",
87+
"org.opencontainers.image.licenses=GPL-3.0-or-later",
88+
"org.opencontainers.image.created=${formatdate("YYYY-MM-DD'T'hh:mm:ss'Z'", timestamp())}",
89+
"${notequal(REVISION, "") ? "org.opencontainers.image.revision=${REVISION}" : ""}"
90+
]
7791
}

src/test/localdev.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
77
bash "$SCRIPT_DIR"/build-dev.sh
88

99
echo '▶️ Starting the localdev PaperMC server...'
10-
# TODO: migrate to Docker compose?
1110
docker run --rm -it -p 25565:25565/tcp -p 25565:25565/udp -e EULA=true 'djaytan/papermc-server:dev'
1211
echo '🛑 The localdev PaperMC server has been stopped and removed.'

0 commit comments

Comments
 (0)