Example steps for using Valohai executions to build Docker images and push them to your (private) registry. The example covers three use cases for different registries (Docker Hub, AWS ECR and GCP Artifact Registry).
- Account (admin) and a valid subscription at app.valohai.com.
- A Git repository containing a
valohai.yaml
with at least one step and all the other required code files. - A Docker registry to push images to.
- A Valohai environment with the docker run argument
--privileged
. Contact Valohai Support (support@valohai.com) if you need one added to your organization.- Note that privileged containers have root capabilities on the host. This is required for running the Docker daemon inside a Docker container in this example.
- Add this repository as a library steps in Valohai.
- Navigate to the Create Execution page on Valohai UI.
- Choose the correct environment.
- Fill in parameters:
- docker-tag - defines the image tag when building and pushing the image.
- repository - required for docker login in AWS and GCP
- Provide the Dockerfile (choose one):
- As an input from a data store connected to the project.
- As the dockerfile parameter.
- Save the credentials as environment variables for authentication:
- Docker Hub: provide
DHUSERNAME
andDHPASSWORD
- AWS ECR: Allow
ValohaiWorkerRole
to push to the repository you are using. - GCP Artifact Registry: create a service account with
Add Service Account Token Creator
andArtifact Registry Writer
roles and provide the JSON key asGCPKEY
.
- Docker Hub: provide