Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akalipetis
Copy link
Member

No description provided.

@akalipetis akalipetis requested a review from Copilot July 7, 2025 15:29
Copy link

@Copilot 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 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
Copy link
Contributor

@pjcdawkins pjcdawkins Jul 17, 2025

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

Copy link
Member Author

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.

@@ -0,0 +1,13 @@
FROM ubuntu:24.04
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
FROM ubuntu:24.04
FROM debian:stable-slim

?

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.

2 participants