# docker.yaml provides details about each Dockerfile in the repo.
# Unlike standard Dockerfiles, Istio builds artifacts outside of docker and then copies them to a temp folder;
# This folder is then passed as the docker context. This avoids complex .dockerignore or large context loads.

# Example image config
example:
- name: helloworld # Name of the image. Will end up pushed to <HUB>/helloworld:<TAG>
  dockerfile: helloworld/Dockerfile.proxyv2
  files:
  # Include a static file
  # Inside the Dockerfile, this is referenced by the base name (README.md), not the full name.
  - samples/README.md
  targets:
  # Build a file with make, then include as a static file
  - ${TARGET_OUT_LINUX}/helloworld

images:

# Base images
- name: base
  dockerfile: docker/Dockerfile.base
  base: true

- name: distroless
  dockerfile: docker/Dockerfile.distroless
  base: true

# Production images
- name: proxyv2
  dockerfile: pilot/docker/Dockerfile.proxyv2
  files:
  - tools/packaging/common/envoy_bootstrap.json
  - ${TARGET_OUT_LINUX}/${RELEASE_MODE}/${SIDECAR}
  targets:
  - ${TARGET_OUT_LINUX}/pilot-agent
- name: pilot
  dockerfile: pilot/docker/Dockerfile.pilot
  targets:
  - ${TARGET_OUT_LINUX}/pilot-discovery

- name: istioctl
  dockerfile: istioctl/docker/Dockerfile.istioctl
  targets:
  - ${TARGET_OUT_LINUX}/istioctl

- name: install-cni
  dockerfile: cni/deployments/kubernetes/Dockerfile.install-cni
  targets:
  - ${TARGET_OUT_LINUX}/istio-cni
  - ${TARGET_OUT_LINUX}/install-cni

- name: ztunnel
  dockerfile: pilot/docker/Dockerfile.ztunnel
  files:
  - ${TARGET_OUT_LINUX}/ztunnel # TODO "${RELEASE_MODE}" to allow separate debug builds

  # Test images
- name: app
  dockerfile: pkg/test/echo/docker/Dockerfile.app
  files:
  - tests/testdata/certs
  targets:
  - ${TARGET_OUT_LINUX}/client
  - ${TARGET_OUT_LINUX}/server

# Sample authz server
- name: ext-authz
  dockerfile: samples/extauthz/docker/Dockerfile
  targets:
    - ${TARGET_OUT_LINUX}/extauthz

# TODO(https://github.com/istio/istio/issues/38224)
- name: app_sidecar_rockylinux_9
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar_centos_8
  files:
  - tools/packaging/common/envoy_bootstrap.json
  - tests/testdata/certs
  - pkg/test/echo/docker/echo-start.sh
  - pkg/test/echo/docker/sudoers
  targets:
  - ${TARGET_OUT_LINUX}/release/istio-sidecar.rpm
  - ${TARGET_OUT_LINUX}/client
  - ${TARGET_OUT_LINUX}/server
- name: app_sidecar_debian_12
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar
  files:
  - tools/packaging/common/envoy_bootstrap.json
  - tests/testdata/certs
  - pkg/test/echo/docker/echo-start.sh
  - pkg/test/echo/docker/sudoers
  targets:
  - ${TARGET_OUT_LINUX}/release/istio-sidecar.deb
  - ${TARGET_OUT_LINUX}/client
  - ${TARGET_OUT_LINUX}/server
  emulationRequired: true
- name: app_sidecar_ubuntu_noble
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar
  files:
  - tools/packaging/common/envoy_bootstrap.json
  - tests/testdata/certs
  - pkg/test/echo/docker/echo-start.sh
  - pkg/test/echo/docker/sudoers
  targets:
  - ${TARGET_OUT_LINUX}/release/istio-sidecar.deb
  - ${TARGET_OUT_LINUX}/client
  - ${TARGET_OUT_LINUX}/server
  emulationRequired: true
- name: app_sidecar_ubuntu_bionic
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar
  files:
  - tools/packaging/common/envoy_bootstrap.json
  - tests/testdata/certs
  - pkg/test/echo/docker/echo-start.sh
  - pkg/test/echo/docker/sudoers
  targets:
  - ${TARGET_OUT_LINUX}/release/istio-sidecar.deb
  - ${TARGET_OUT_LINUX}/client
  - ${TARGET_OUT_LINUX}/server
  emulationRequired: true

# Test base images
- name: app_sidecar_base_debian_12 # latest debian
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar_base
  base: true
- name: app_sidecar_base_ubuntu_noble # newest ubuntu
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar_base
  base: true
- name: app_sidecar_base_ubuntu_bionic # oldest supported ubuntu
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar_base
  base: true
#  TODO(https://github.com/istio/istio/issues/38224)
- name: app_sidecar_base_rockylinux_9 # newest RHEL-based
  dockerfile: pkg/test/echo/docker/Dockerfile.app_sidecar_base_centos
  base: true
