From 43a20f45e8c3632f5c237d974d7b3f56d9c26cb6 Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Thu, 5 Feb 2026 15:36:21 +0200 Subject: [PATCH 1/3] feat: add Docker support for Upsun CLI with build and push workflow --- .github/workflows/release.yml | 63 +++++++++++++++++++++++++++++++++++ Dockerfile | 13 ++++++++ README.md | 15 +++++++++ 3 files changed, 91 insertions(+) create mode 100644 Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b901b91..e8660346 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + packages: write jobs: release: @@ -120,3 +121,65 @@ jobs: if: always() run: | rm -rf "${{ steps.signing-keys.outputs.key_dir }}" + + docker: + runs-on: ${{ matrix.runner }} + needs: release + strategy: + matrix: + include: + - runner: ubuntu-latest + platform: linux/amd64 + suffix: amd64 + - runner: ubuntu-24.04-arm + platform: linux/arm64 + suffix: arm64 + permissions: + contents: read + packages: write + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: https://github.com/${{ github.repository }}.git#${{ github.ref }} + platforms: ${{ matrix.platform }} + push: true + tags: ghcr.io/upsun/cli:${{ github.ref_name }}-${{ matrix.suffix }} + build-args: | + VERSION=${{ github.ref_name }} + cache-from: type=gha,scope=${{ matrix.suffix }} + cache-to: type=gha,mode=max,scope=${{ matrix.suffix }} + + docker-manifest: + runs-on: ubuntu-latest + needs: docker + permissions: + packages: write + steps: + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest + run: | + docker manifest create ghcr.io/upsun/cli:${{ github.ref_name }} \ + ghcr.io/upsun/cli:${{ github.ref_name }}-amd64 \ + ghcr.io/upsun/cli:${{ github.ref_name }}-arm64 + docker manifest push ghcr.io/upsun/cli:${{ github.ref_name }} + docker manifest create ghcr.io/upsun/cli:latest \ + ghcr.io/upsun/cli:${{ github.ref_name }}-amd64 \ + ghcr.io/upsun/cli:${{ github.ref_name }}-arm64 + docker manifest push ghcr.io/upsun/cli:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..364ccf04 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:24.04 + +# Install dependencies +RUN apt-get update && \ + apt-get install -y curl bash git ssh-client && \ + rm -rf /var/lib/apt/lists/* + +# Install Upsun CLI +ARG VERSION= +RUN curl -fsSL https://raw.githubusercontent.com/upsun/cli/main/installer.sh | INSTALL_METHOD=raw VERSION=$VERSION bash + +# Default command +ENTRYPOINT ["upsun"] diff --git a/README.md b/README.md index 77be0ee1..ed706c42 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,20 @@ sudo dnf install -y upsun-cli For manual installation, you can also [download the latest binaries](https://github.com/upsun/cli/releases/latest). +### Docker + +The CLI is also available as a Docker image: + +```console +docker run --rm -it ghcr.io/upsun/cli +``` + +To use a specific version: + +```console +docker run --rm -it ghcr.io/upsun/cli:6.0.0 +``` + ## Upgrade Upgrade using the same tool: @@ -188,6 +202,7 @@ Releases are automated via GitHub Actions. To create a new release: - Sign packages (APK, DEB, RPM) - Create a GitHub release with all artifacts - Update package repositories at repositories.upsun.com + - Build and push Docker image to ghcr.io/upsun/cli ## Licenses From e0e6bdda55cf5bf5b02ca1037fd0312edd36345c Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Thu, 5 Feb 2026 16:41:43 +0200 Subject: [PATCH 2/3] fix: add --no-install-recommends to apt-get install for smaller image size --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 364ccf04..03c9404d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:24.04 # Install dependencies RUN apt-get update && \ - apt-get install -y curl bash git ssh-client && \ + apt-get install -y --no-install-recommends curl bash git ssh-client && \ rm -rf /var/lib/apt/lists/* # Install Upsun CLI From 95f5583898a86a7945996853e645bef6721027bf Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Thu, 5 Feb 2026 16:42:50 +0200 Subject: [PATCH 3/3] fix: add correct named version example Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed706c42..c43c34d2 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ docker run --rm -it ghcr.io/upsun/cli To use a specific version: ```console -docker run --rm -it ghcr.io/upsun/cli:6.0.0 +docker run --rm -it ghcr.io/upsun/cli:v6.0.0 ``` ## Upgrade