Custom image

Instructions to use a custom docker image

To use your own custom docker image, you can set image: AUTO in your service module.

name: hello
environments:
  - name: staging
    path: "opta.yaml"
modules:
  - name: hello
    type: k8s-service
    port:
      http: 80
    image: AUTO
    healthcheck_path: "/"
    public_uri: "/hello"

For this example, we will make a simple change to our hello application (also available on github).

Build the image locally:

docker build . -t hello-opta:v2

Deploy the new image to the kubernetes cluster:

opta deploy --image hello-opta:v2

This will:

  1. Push the image to the private container registry (ECR, GCR, ACR) - this registry is created during environment creation.
  2. Update the kubernetes deployment to use the new container image.
  3. Create new pods to use the new container image - automatically done by kubernetes.

No need to manually manage the repositories!

Note: If you deploy an Image with an already existing tag image, Opta would still detect those changes and make sure the image is deployed again.


Last modified August 5, 2022 : Cleanup install script (#197) (2175394)