Skip to content

Deploy a container image

Already build your app in CI? Deploy the finished image instead of building from source. DockHive pulls it, checks that it starts and answers its health check, then switches traffic to it, just like a build from GitHub. Versions, rollbacks, logs, environment variables and custom domains all work the same way.

  1. In App Hosting, click Deploy an image.
  2. Fill in:
    • App name and Region.
    • Image: the image pinned to a digest, for example ghcr.io/team/app@sha256:…. A tag such as :latest on its own isn’t accepted, so you always know exactly what’s running.
    • Port: the port your app listens on. Leave it empty to use the port the image declares (EXPOSE).
    • Health check path, App type (web or background worker) and App size, if you need them.
    • Environment variables, one NAME=value per line.
    • Registry login (private images only): a username and a password or access token.
  3. Click Deploy image.

To find an image’s digest, run:

Terminal window
docker buildx imagetools inspect ghcr.io/team/app:v1.4.0

or copy it from your CI’s build output.

  • Built for linux/amd64.
  • From a registry reachable on the internet, such as GitHub Container Registry, Docker Hub, GitLab, Google Artifact Registry or Amazon ECR.
  • Up to 8 GB unpacked.

Your image gets the same protections and limits as every DockHive app.

Open the app. The Image card shows the digest that’s running. Paste a new digest under Deploy a new digest and deploy it. The previous version stays available for rollback.

Save a registry login on the app’s Image card, or when you deploy. It’s stored encrypted, is never shown again, and is only sent to the registry it was saved for. Click Remove to delete it. Use a read-only access token where your registry supports one.

Terminal window
curl -X POST "https://api.dockhive.io/api/v1/apps/deploy" \
-H "Authorization: Bearer $DOCKHIVE_API_KEY" \
-H "X-Region: eu" \
-H "Content-Type: application/json" \
-d '{
"name": "my-api",
"image": "ghcr.io/team/app@sha256:…",
"app_port": 8080,
"registry_username": "ci-bot",
"registry_password": "'"$REGISTRY_TOKEN"'"
}'

To deploy a new digest to an existing app, send the same request to /api/v1/apps/projects/PROJECT_ID/deploy with the new image.

Error Meaning
image_not_pinned Add the @sha256:… digest to the image.
invalid_image The image reference isn’t valid.