Deploy
Docker images
Run a public Docker image as a service.
An image service runs a Docker image from a registry such as Docker Hub or GitHub Container Registry.
Create an image service
Open the project
Open a project and click New service → Docker image.
Fill in the form
Name
required
Up to 64 characters, for example
Web.Image
required
The image with its tag, for example
nginx:latest or ghcr.io/acme/web:1.4.Port
The port your app listens on, from 1 to 65535. Leave it empty if the service doesn't take requests, such as a worker.
Create it
Click Create service. Harblet deploys the image right away.
Follow the deployment on the service's Deployments tab. See Deployments and logs.
Harblet pulls images without credentials, so the image must be public. To deploy private code, use a Git repository instead.
Deploy a new version
Every deploy pulls the image's tag again. To ship a new version:
- Under the same tag, for example
latest: push the new image, then click Deploy, or call the service's deploy hook from your pipeline. - Under a new tag: change Image under Settings, click Save, then click Deploy.
The port
The port tells Harblet where your app takes requests. Harblet uses it for:
- the service's internal address, which other services in the project connect to,
- the health check of every new deployment,
- traffic from the service's domains.
Harblet doesn't pass the port to an image service. Configure the image to listen on it, usually with an environment variable the image documents.
Things to know
- The container must keep running. A container that exits, such as a one-off task, counts as crashed and fails the deployment.
- Files on the container's disk don't last. They are lost on every deploy and restart. Keep data in a database or in external storage.
- Restarts pull again. A service that runs a tag asks its registry for the image every time it starts, also after a server reboot. If the registry can't be reached, the service stays down until it can.