-
Notifications
You must be signed in to change notification settings - Fork 12
Publish a Docker image to GHCR on every release #251
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds a Docker image definition for the upsun
CLI and configures a GitHub Actions workflow to build and publish it to GHCR on each release.
- Introduces a
Dockerfile
to install the Platform.sh CLI in an Ubuntu-based container - Adds a
publish-ghcr.yml
workflow triggered on release publish events to build and push the image
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
Dockerfile | Define container with Ubuntu, install dependencies, and set up the Platform.sh CLI installer |
.github/workflows/publish-ghcr.yml | Configure release-triggered workflow to build and push Docker image to GHCR |
Comments suppressed due to low confidence (3)
Dockerfile:9
- [nitpick] Provide a default value for
VERSION
or document in the README how to supply this build argument so users know which CLI version will be installed.
ARG VERSION=
.github/workflows/publish-ghcr.yml:27
- To maximize platform support, add a
platforms
field in the build step (e.g.,platforms: linux/amd64,linux/arm64
) so you publish multi-arch images.
- name: Build and push Docker image
Dockerfile:10
- Piping an external script directly to
bash
can be risky. Consider downloading the installer and verifying its checksum or GPG signature before executing.
RUN curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | VENDOR=upsun INSTALL_METHOD=raw VERSION=$VERSION bash
push: true | ||
tags: | | ||
ghcr.io/platformsh/upsun-cli:${{ github.event.release.tag_name }} | ||
ghcr.io/platformsh/upsun-cli:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems we should/could make it ghcr.io/upsun/cli
and we should/could also publish ghcr.io/platformsh/cli
? - if so it'd need multiple or generated Dockerfiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can easily parametrize the Dockerfile with a dynamic VENDOR
argument for that, no need for multiple or generated Dockerfiles.
The idea was that we don't need a Platform.sh CLI image for now, that's why I didn't mess with it - otherwise I'm happy to adjust.
Co-authored-by: Patrick Dawkins <[email protected]>
@@ -0,0 +1,13 @@ | |||
FROM ubuntu:24.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM ubuntu:24.04 | |
FROM debian:stable-slim |
?
No description provided.