Skip to content

Automatically build and publish container images to Github Container Repo#23

Open
leonardehrenfried wants to merge 7 commits intopatrickbr:masterfrom
leonardehrenfried:master
Open

Automatically build and publish container images to Github Container Repo#23
leonardehrenfried wants to merge 7 commits intopatrickbr:masterfrom
leonardehrenfried:master

Conversation

@leonardehrenfried
Copy link
Copy Markdown

@leonardehrenfried leonardehrenfried commented Feb 15, 2024

Just like the PR over at pfaedle, this one automatically builds container images for this repo and deploys them to Github Container Repo.

You can see an example here: https://github.com/leonardehrenfried/gtfstidy/pkgs/container/gtfstidy

A complete example of how to use it would be:

wget https://www3.septa.org/developer/google_bus.zip
docker run --rm -v `pwd`:/app ghcr.io/leonardehrenfried/gtfstidy:latest -S -o /app/tidy.gtfs.zip /app/google_bus.zip

Do you want me to add that to the documentation?

RUN go mod tidy
RUN go build .

FROM docker.io/debian:stable-slim
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add OCI annotations, to provide helpful machine-readable infos to a variety of tools.

Suggested change
FROM docker.io/debian:stable-slim
FROM docker.io/debian:stable-slim
LABEL org.opencontainers.image.title="oxygen-xml"
LABEL org.opencontainers.image.description="A tool for checking, sanitizing and minimizing GTFS feeds."
LABEL org.opencontainers.image.authors="Patrick Brosi <info@patrickbrosi.de>"
LABEL org.opencontainers.image.source="https://github.com/patrickbr/gtfstidy"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

docker/metadata-action actually already adds most (all?) of these labels from the GitHub metadata.

Can you check the pfaedle image (which uses the same process) to see if you're missing something? https://github.com/ad-freiburg/pfaedle/pkgs/container/pfaedle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I didn't know. Consider this thread irrelevant then.

derhuerst added a commit to public-transport/transitous that referenced this pull request Feb 26, 2024
@leonardehrenfried
Copy link
Copy Markdown
Author

Would it be possible to get a review for this?

@leonardehrenfried
Copy link
Copy Markdown
Author

Hello, it's me again. Can I get a review for this PR?

@lenalebt
Copy link
Copy Markdown

lenalebt commented May 6, 2025

I would also love to get this 😇 . Any chance to get it merged?

@lenalebt
Copy link
Copy Markdown

lenalebt commented May 6, 2025

@leonardehrenfried I forked your version to https://github.com/GeoSci-GmbH/gtfstidy-docker to use the original repo in the pipeline. It will build a new version every 3 months and patch the latest tag. I will delete that fork as soon as this is merged :-).

Until then, you can find the version at ghcr.io/geosci-gmbh/gtfstidy-docker:latest


WORKDIR src

COPY *.go ./
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

go.mod and go.sum are missing.

This will allow to remove the go mod commands below.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review. However I'm a little reluctant to work on this as this PR has been open for a while and I've not received any feedback from the repo owner.


COPY --from=builder /go/src/gtfstidy /usr/local/bin/gtfstidy

ENTRYPOINT ["/usr/local/bin/gtfstidy"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Move entrypoint above for a better use of layers, as the binary changes more often.

RUN go mod tidy
RUN go build .

FROM docker.io/debian:stable-slim
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A smaller base image would be better.

Ideally only the binary and tzdata.

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.

4 participants