UNCLASSIFIED - NO CUI

Need to add version after FROM statement otherwise ISTIO_META_ISTIO_VERSION is empty

Summary

The Istio version comes up empty in ISTIO_META_ISTIO_VERSION

This is because an ARG declared before the FROM instruction can't be used after the FROM

Steps to reproduce

docker run -it --entrypoint bash registry1.dso.mil/ironbank/opensource/istio/proxyv2:1.10.3
[istio-proxy@e0f4bc8eb9ef /]$ env | grep ISTIO_VERSION
ISTIO_META_ISTIO_VERSION=

What is the current bug behavior?

ISTIO_META_ISTIO_VERSION is empty.

What is the expected correct behavior?

ISTIO_META_ISTIO_VERSION=1.10.3

Possible fixes

Add ARG version on line 11: https://repo1.dso.mil/dsop/opensource/istio/1.10/proxyv2/-/blob/development/Dockerfile#L11

Here is the proposed change.

# Updated by Renovate
ARG version="1.10.3"

FROM istio/proxyv2:${version} AS base

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}

# Need to repeat version after FROM
ARG version

# Environment variable indicating the exact proxy sha - for debugging or version-specific configs
# Iron Bank cannot provide a meaningful SHA here, set it to a placeholder value
ENV ISTIO_META_ISTIO_PROXY_SHA=isto-proxy:ironbank
# Environment variable indicating the exact build, for debugging
ENV ISTIO_META_ISTIO_VERSION=${version}

Defintion of Done

  • Bug has been identified and corrected within the container
Edited by Jacob Rohlman