From c76f573063348e7bbf97524845f057f7e50498ab Mon Sep 17 00:00:00 2001 From: jamie-at-bunny Date: Wed, 19 Aug 2026 13:45:11 +0100 Subject: [PATCH 1/3] Add Apple Container push instructions and Bunny registry GitHub Actions variant Co-Authored-By: Claude Fable 5 --- magic-containers/bunny-container-registry.mdx | 40 +++++- .../deploy-with-github-actions.mdx | 126 ++++++++++++------ 2 files changed, 126 insertions(+), 40 deletions(-) diff --git a/magic-containers/bunny-container-registry.mdx b/magic-containers/bunny-container-registry.mdx index a63a5835..2da44c13 100644 --- a/magic-containers/bunny-container-registry.mdx +++ b/magic-containers/bunny-container-registry.mdx @@ -10,7 +10,7 @@ Bunny Container Registry is in **Preview**. Usage is temporarily free during the Bunny Container Registry is a private, OCI-compliant container registry built into bunny.net. Push images from your machine or CI pipeline and they immediately show up in the Magic Containers image list, ready to deploy. No external registry or credential setup required. -The registry is available at `registry.bunny.net`. Repositories are private to your account and namespaced by your account ID (`/my-app`). The [bunny CLI](/cli) manages this namespace for you, so you only need your account ID when [pushing with Docker directly](#pushing-with-docker). +The registry is available at `registry.bunny.net`. Repositories are private to your account and namespaced by your account ID (`/my-app`). The [bunny CLI](/cli) manages this namespace for you, so you only need your account ID when pushing with [Docker](#pushing-with-docker) or [Apple Container](#pushing-with-apple-container) directly. Magic Containers only supports images built for the **linux/amd64** architecture. When building your container image, ensure you target this platform using `--platform linux/amd64`. @@ -101,7 +101,7 @@ docker tag my-app registry.bunny.net//my-app:latest ``` -Need your account ID? Run [`bunny whoami`](/cli/commands/auth#bunny-whoami), which prints it. You can also find it in the dashboard: go to [Image Registries](https://dash.bunny.net/magic-containers/image-registries) and click **How to Push Images** to see these Docker commands with your account ID already filled in. +Run [`bunny whoami`](/cli/commands/auth#bunny-whoami) to get your account ID. You can also find it in the dashboard: go to [Image Registries](https://dash.bunny.net/magic-containers/image-registries) and click **How to Push Images** to see these Docker commands with your account ID already filled in. ### Push the image @@ -112,10 +112,46 @@ docker push registry.bunny.net//my-app:latest Once pushed, the image appears in the Magic Containers image list, where you can select it to deploy. +## Pushing with Apple Container + +[Apple Container](https://github.com/apple/container) is Apple's open-source container tool for macOS. Its registry commands work with the Bunny Container Registry the same way Docker's do: you handle authentication and the account namespace yourself. + +### Log in to the registry + +Authenticate with `token` as the username and your [API key](/account/api-keys) as the password: + +```bash +container registry login registry.bunny.net --username token +``` + +### Build for linux/amd64 + +On Apple silicon, Apple Container builds images for `arm64` by default, which Magic Containers can't run. Pass `--arch amd64` when building: + +```bash +container build --arch amd64 --tag registry.bunny.net//my-app:latest . +``` + +If you already have an image built for `amd64`, tag it with the registry host and your account ID instead: + +```bash +container image tag my-app registry.bunny.net//my-app:latest +``` + +### Push the image + +```bash +container image push registry.bunny.net//my-app:latest +``` + +Once pushed, the image appears in the Magic Containers image list, where you can select it to deploy. + ## Deploying pushed images Images pushed to the Bunny Container Registry appear automatically in the image list when you [deploy](/magic-containers/deploy) or [update](/magic-containers/update) a Magic Containers app. Select the repository and tag to deploy; no registry credentials need to be configured. +To automate the whole flow, so every push to your repository builds an image, pushes it to the registry, and rolls it out, see [Deploy with GitHub Actions](/magic-containers/deploy-with-github-actions). + ## Limits The following limits apply to each account: diff --git a/magic-containers/deploy-with-github-actions.mdx b/magic-containers/deploy-with-github-actions.mdx index e54b4a16..82115c51 100644 --- a/magic-containers/deploy-with-github-actions.mdx +++ b/magic-containers/deploy-with-github-actions.mdx @@ -9,49 +9,99 @@ Automate your deployments by integrating Magic Containers with GitHub Actions. W - An application already deployed on the Magic Containers platform - A GitHub repository containing a Dockerfile or valid build context -- Container registry credentials (use `GITHUB_TOKEN` for GitHub Container Registry, or personal access tokens for DockerHub) +- Container registry credentials (your bunny.net API key for the [Bunny Container Registry](/magic-containers/bunny-container-registry), `GITHUB_TOKEN` for GitHub Container Registry, or a personal access token for DockerHub) ## Quickstart Add a step to your GitHub Actions workflow with the following inputs: `app_id`, `api_key`, `container`, and `image_tag`. This triggers a rolling update whenever a new image is built and pushed. -```yml -name: Update container image when pushing to main - -on: - push: - branches: - - "main" - -jobs: - build: - name: Build and deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: docker login - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: docker build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ghcr.io/${{ github.repository }}:${{ github.sha }} - - - name: Update container image on Magic Containers - uses: BunnyWay/actions/container-update-image@main - with: - app_id: ${{ vars.APP_ID }} - api_key: ${{ secrets.BUNNYNET_API_KEY }} - container: app - image_tag: "${{ github.sha }}" -``` + + + Log in to the [Bunny Container Registry](/magic-containers/bunny-container-registry) with `token` as the username and your API key as the password. The same API key secret authenticates both the registry push and the Magic Containers update. Store your account ID as a repository variable; it namespaces the image path. + + + Run [`bunny whoami`](/cli/commands/auth#bunny-whoami) to get your account ID. You can also find it in the dashboard under [Image Registries](https://dash.bunny.net/magic-containers/image-registries) by clicking **How to Push Images**. + + + ```yml + name: Update container image when pushing to main + + on: + push: + branches: + - "main" + + jobs: + build: + name: Build and deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: docker login + uses: docker/login-action@v3 + with: + registry: registry.bunny.net + username: token + password: ${{ secrets.BUNNYNET_API_KEY }} + + - name: docker build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64 + tags: registry.bunny.net/${{ vars.BUNNYNET_ACCOUNT_ID }}/my-app:${{ github.sha }} + + - name: Update container image on Magic Containers + uses: BunnyWay/actions/container-update-image@main + with: + app_id: ${{ vars.APP_ID }} + api_key: ${{ secrets.BUNNYNET_API_KEY }} + container: app + image_tag: "${{ github.sha }}" + ``` + + + ```yml + name: Update container image when pushing to main + + on: + push: + branches: + - "main" + + jobs: + build: + name: Build and deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: docker login + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: docker build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.sha }} + + - name: Update container image on Magic Containers + uses: BunnyWay/actions/container-update-image@main + with: + app_id: ${{ vars.APP_ID }} + api_key: ${{ secrets.BUNNYNET_API_KEY }} + container: app + image_tag: "${{ github.sha }}" + ``` + + ## Inputs From 0ead9f410680c20e0618ef11371bb91a442ae054 Mon Sep 17 00:00:00 2001 From: jamie-at-bunny Date: Wed, 19 Aug 2026 14:34:44 +0100 Subject: [PATCH 2/3] use steps components --- magic-containers/bunny-container-registry.mdx | 56 ++++++++++++++----- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/magic-containers/bunny-container-registry.mdx b/magic-containers/bunny-container-registry.mdx index 2da44c13..6858d948 100644 --- a/magic-containers/bunny-container-registry.mdx +++ b/magic-containers/bunny-container-registry.mdx @@ -10,7 +10,7 @@ Bunny Container Registry is in **Preview**. Usage is temporarily free during the Bunny Container Registry is a private, OCI-compliant container registry built into bunny.net. Push images from your machine or CI pipeline and they immediately show up in the Magic Containers image list, ready to deploy. No external registry or credential setup required. -The registry is available at `registry.bunny.net`. Repositories are private to your account and namespaced by your account ID (`/my-app`). The [bunny CLI](/cli) manages this namespace for you, so you only need your account ID when pushing with [Docker](#pushing-with-docker) or [Apple Container](#pushing-with-apple-container) directly. +The registry is available at `registry.bunny.net`. Repositories are private to your account and namespaced by your account ID (`/my-app`). The [bunny.net CLI](/cli) manages this namespace for you, so you only need your account ID when pushing with [Docker](#pushing-with-docker) or [Apple Container](#pushing-with-apple-container) directly. Magic Containers only supports images built for the **linux/amd64** architecture. When building your container image, ensure you target this platform using `--platform linux/amd64`. @@ -18,7 +18,7 @@ Magic Containers only supports images built for the **linux/amd64** architecture ## Quickstart -The recommended way to push images is with the [bunny CLI](/cli). It handles authentication and the account namespace for you, so no registry configuration is needed. +The recommended way to push images is with the [bunny.net CLI](/cli). `bunny registry` is **experimental** and may change in future releases. @@ -26,7 +26,7 @@ The recommended way to push images is with the [bunny CLI](/cli). It handles aut - + If you haven't already, [install the CLI](/cli/installation) and authenticate: @@ -56,11 +56,13 @@ The image now appears in the Magic Containers image list. Select it when you [de -## Using the bunny CLI +## Using the bunny.net CLI The [`bunny registry`](/cli/commands/registry) command pushes images and lists repositories and tags on the registry. Unlike Docker, you don't need to tag images with the registry host or your account ID: the CLI adds and hides the account namespace automatically, so you always work with the bare repository name. -### Push to an explicit repository and tag + + + Without flags, `push` derives the repository and tag from the image name. Override either with flags: @@ -68,7 +70,11 @@ Without flags, `push` derives the repository and tag from the image name. Overri bunny registry push my-app:dev --repository my-app --tag v1 ``` -### List repositories and tags + + + + +Verify the push by listing what's on the registry: ```bash # List repositories (alias: ls) @@ -80,11 +86,17 @@ bunny registry tags my-app `list` and `tags` talk to the registry directly and don't require Docker. + + + + ## Pushing with Docker -If you can't use the bunny CLI, for example in a CI pipeline where only Docker is available, you can push images with Docker directly. Unlike the CLI, you handle authentication and the account namespace yourself. +If you can't use the bunny.net CLI, for example in a CI pipeline where only Docker is available, you can push images with Docker directly. Unlike the CLI, you handle authentication and the account namespace yourself. + + -### Log in to the registry + Authenticate with `token` as the username and your [API key](/account/api-keys) as the password: @@ -92,7 +104,9 @@ Authenticate with `token` as the username and your [API key](/account/api-keys) docker login registry.bunny.net --username token ``` -### Tag your image + + + Tag the image with the registry host and your account ID. Replace `my-app` with the name of your image and `` with your account ID: @@ -104,7 +118,9 @@ docker tag my-app registry.bunny.net//my-app:latest Run [`bunny whoami`](/cli/commands/auth#bunny-whoami) to get your account ID. You can also find it in the dashboard: go to [Image Registries](https://dash.bunny.net/magic-containers/image-registries) and click **How to Push Images** to see these Docker commands with your account ID already filled in. -### Push the image + + + ```bash docker push registry.bunny.net//my-app:latest @@ -112,11 +128,17 @@ docker push registry.bunny.net//my-app:latest Once pushed, the image appears in the Magic Containers image list, where you can select it to deploy. + + + + ## Pushing with Apple Container [Apple Container](https://github.com/apple/container) is Apple's open-source container tool for macOS. Its registry commands work with the Bunny Container Registry the same way Docker's do: you handle authentication and the account namespace yourself. -### Log in to the registry + + + Authenticate with `token` as the username and your [API key](/account/api-keys) as the password: @@ -124,7 +146,9 @@ Authenticate with `token` as the username and your [API key](/account/api-keys) container registry login registry.bunny.net --username token ``` -### Build for linux/amd64 + + + On Apple silicon, Apple Container builds images for `arm64` by default, which Magic Containers can't run. Pass `--arch amd64` when building: @@ -138,7 +162,9 @@ If you already have an image built for `amd64`, tag it with the registry host an container image tag my-app registry.bunny.net//my-app:latest ``` -### Push the image + + + ```bash container image push registry.bunny.net//my-app:latest @@ -146,6 +172,10 @@ container image push registry.bunny.net//my-app:latest Once pushed, the image appears in the Magic Containers image list, where you can select it to deploy. + + + + ## Deploying pushed images Images pushed to the Bunny Container Registry appear automatically in the image list when you [deploy](/magic-containers/deploy) or [update](/magic-containers/update) a Magic Containers app. Select the repository and tag to deploy; no registry credentials need to be configured. From 8febad4b3ef91b6fbbdab17a3bb6e96c43924f31 Mon Sep 17 00:00:00 2001 From: jamie-at-bunny Date: Wed, 19 Aug 2026 14:48:51 +0100 Subject: [PATCH 3/3] Clarify Docker CLI requirement for bunny registry push Co-Authored-By: Claude Fable 5 --- magic-containers/bunny-container-registry.mdx | 2 +- .../deploy-with-github-actions.mdx | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/magic-containers/bunny-container-registry.mdx b/magic-containers/bunny-container-registry.mdx index 6858d948..9efc69a5 100644 --- a/magic-containers/bunny-container-registry.mdx +++ b/magic-containers/bunny-container-registry.mdx @@ -44,7 +44,7 @@ Push a local Docker image by name. The CLI tags it for the registry and pushes i bunny registry push my-app:latest ``` -`push` uses Docker to read the local image, so Docker must be installed and the image must exist locally. +`push` shells out to the Docker CLI, so Docker must be installed and the image must exist in Docker's image store. Images built with Apple Container aren't visible to Docker; push those with [`container image push`](#pushing-with-apple-container) instead. diff --git a/magic-containers/deploy-with-github-actions.mdx b/magic-containers/deploy-with-github-actions.mdx index 82115c51..c7cb17af 100644 --- a/magic-containers/deploy-with-github-actions.mdx +++ b/magic-containers/deploy-with-github-actions.mdx @@ -9,20 +9,14 @@ Automate your deployments by integrating Magic Containers with GitHub Actions. W - An application already deployed on the Magic Containers platform - A GitHub repository containing a Dockerfile or valid build context -- Container registry credentials (your bunny.net API key for the [Bunny Container Registry](/magic-containers/bunny-container-registry), `GITHUB_TOKEN` for GitHub Container Registry, or a personal access token for DockerHub) +- Container registry credentials (`GITHUB_TOKEN` for GitHub Container Registry, your bunny.net API key for the [Bunny Container Registry](/magic-containers/bunny-container-registry), or a personal access token for DockerHub) ## Quickstart Add a step to your GitHub Actions workflow with the following inputs: `app_id`, `api_key`, `container`, and `image_tag`. This triggers a rolling update whenever a new image is built and pushed. - - Log in to the [Bunny Container Registry](/magic-containers/bunny-container-registry) with `token` as the username and your API key as the password. The same API key secret authenticates both the registry push and the Magic Containers update. Store your account ID as a repository variable; it namespaces the image path. - - - Run [`bunny whoami`](/cli/commands/auth#bunny-whoami) to get your account ID. You can also find it in the dashboard under [Image Registries](https://dash.bunny.net/magic-containers/image-registries) by clicking **How to Push Images**. - - + ```yml name: Update container image when pushing to main @@ -41,17 +35,16 @@ Add a step to your GitHub Actions workflow with the following inputs: `app_id`, - name: docker login uses: docker/login-action@v3 with: - registry: registry.bunny.net - username: token - password: ${{ secrets.BUNNYNET_API_KEY }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: docker build and push uses: docker/build-push-action@v5 with: context: . push: true - platforms: linux/amd64 - tags: registry.bunny.net/${{ vars.BUNNYNET_ACCOUNT_ID }}/my-app:${{ github.sha }} + tags: ghcr.io/${{ github.repository }}:${{ github.sha }} - name: Update container image on Magic Containers uses: BunnyWay/actions/container-update-image@main @@ -62,7 +55,13 @@ Add a step to your GitHub Actions workflow with the following inputs: `app_id`, image_tag: "${{ github.sha }}" ``` - + + Log in to the [Bunny Container Registry](/magic-containers/bunny-container-registry) with `token` as the username and your API key as the password. The same API key secret authenticates both the registry push and the Magic Containers update. Store your account ID as a repository variable; it namespaces the image path. + + + Run [`bunny whoami`](/cli/commands/auth#bunny-whoami) to get your account ID. You can also find it in the dashboard under [Image Registries](https://dash.bunny.net/magic-containers/image-registries) by clicking **How to Push Images**. + + ```yml name: Update container image when pushing to main @@ -81,16 +80,17 @@ Add a step to your GitHub Actions workflow with the following inputs: `app_id`, - name: docker login uses: docker/login-action@v3 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + registry: registry.bunny.net + username: token + password: ${{ secrets.BUNNYNET_API_KEY }} - name: docker build and push uses: docker/build-push-action@v5 with: context: . push: true - tags: ghcr.io/${{ github.repository }}:${{ github.sha }} + platforms: linux/amd64 + tags: registry.bunny.net/${{ vars.BUNNYNET_ACCOUNT_ID }}/my-app:${{ github.sha }} - name: Update container image on Magic Containers uses: BunnyWay/actions/container-update-image@main