Skip to main content Link Search Menu Expand Document (external link)

Container image

The container-image traits permits to modify the container image to be deployed. This is specially useful for component definitions that do not provide the image as part of their properties.

The following snippet shows an application where the component image is overwritten with a new one.

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: my-app
  annotations: 
    version: "v0.0.1"
    description: "My application"
spec:
  components:
    - name: my-component
      type: worker
      properties:
        image: my-app-image:v1.0.0
        cmd: ["cmd"]
      traits:
        - type: container-image # Set to container-image
          properties:
            containerName: container-name # (Optional) name of the target container. If not set, the image will be applied to the main container
            image: my-container-image:v1.0.0 # (Required) image            
            imagePullPolicy: IfNotPresent # (Optional) image pull policy