Skip to content

feat(docker): add labels, pin alpine tag to the latest version#1832

Merged
CommanderStorm merged 5 commits intomaplibre:mainfrom
NINNiT:feat/dockerfile-improvements
May 18, 2025
Merged

feat(docker): add labels, pin alpine tag to the latest version#1832
CommanderStorm merged 5 commits intomaplibre:mainfrom
NINNiT:feat/dockerfile-improvements

Conversation

@NINNiT
Copy link
Copy Markdown
Contributor

@NINNiT NINNiT commented May 17, 2025

Just a few minimal Dockerfile improvements.


Adds the following standardized Dockerfile Labels:

LABEL org.opencontainers.image.source="https://github.com/maplibre/martin" 
LABEL org.opencontainers.image.licenses="Apache-2.0 OR MIT"

I've noticed that some dependency upgrade tools (renovate, dependabot, ...) can't fetch the martin changelog when creating Bump MRs. org.opencontainers.image.source should alleviate that..
Providing the licenses also doesn't hurt.


Furthermore I've pinned the tag to latest, which makes it a bit cleaner. (same behavior as not pinning the tag at all).
Pinning to a fixed version would be better - but without some sort of automation, keeping the tag up-to-date can be a hassle.

Seems like there are no problems regarding CI image caching however, as martin is already using the newest alpine version:

docker run --entrypoint /bin/sh ghcr.io/maplibre/martin:v0.16.0 -c "cat /etc/os-release""
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.21.3
PRETTY_NAME="Alpine Linux v3.21"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

Copilot AI review requested due to automatic review settings May 17, 2025 22:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces two minimal improvements to the Dockerfile by standardizing OCI labels and pinning the base image tag.

  • Updates the FROM instruction to use alpine:latest.
  • Adds standardized labels for image source and licenses.

@@ -1,7 +1,11 @@
FROM alpine
FROM alpine:3.21
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have automatic dependency updates on
=> we get notified if something here is breaking => pinning to minor is imo fine for this one ^^

Copy link
Copy Markdown
Member

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements

@CommanderStorm CommanderStorm enabled auto-merge (squash) May 17, 2025 23:29
@CommanderStorm CommanderStorm disabled auto-merge May 17, 2025 23:31
@CommanderStorm CommanderStorm enabled auto-merge (squash) May 17, 2025 23:36
@CommanderStorm CommanderStorm disabled auto-merge May 17, 2025 23:38
@CommanderStorm CommanderStorm enabled auto-merge (squash) May 17, 2025 23:43
@CommanderStorm CommanderStorm disabled auto-merge May 17, 2025 23:51
@CommanderStorm
Copy link
Copy Markdown
Member

Actually, I am not sure if we use these labels or completely ignore them:

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
# https://github.com/docker/metadata-action
with:
images: ghcr.io/${{ github.repository }}
- name: Push the Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
file: .github/files/multi-platform.Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

Will have to investigate

@CommanderStorm CommanderStorm changed the title feat(docker): add labels, pin tag to latest feat(docker): add labels, pin alpine tag to the latest version May 18, 2025
@CommanderStorm CommanderStorm merged commit 4a33ccd into maplibre:main May 18, 2025
20 checks passed
@CommanderStorm
Copy link
Copy Markdown
Member

(simplest way to investigate is merging and looking at the :main image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants