Problem
In tools/docker-images/clp-package/Dockerfile, the USER and ENV commands are declared in the base stage (lines 13-18) before the image is flattened using FROM scratch and COPY --from=base. This causes their effects to be lost in the final image.
Details
The following directives are currently in the base stage:
ENV CLP_HOME="/opt/clp"
ENV PATH="${CLP_HOME}/bin:${PATH}"
ENV PATH="${CLP_HOME}/sbin:${PATH}"
ENV PYTHONPATH="${CLP_HOME}/lib/python3/site-packages"
USER 1000:1000
When the image is flattened with FROM scratch followed by COPY --from=base / /, these directives are not preserved in the final image metadata.
Solution
These directives should be moved to after the COPY --from=base / / command in the final stage to ensure they are present in the resulting image.
References
Problem
In
tools/docker-images/clp-package/Dockerfile, theUSERandENVcommands are declared in the base stage (lines 13-18) before the image is flattened usingFROM scratchandCOPY --from=base. This causes their effects to be lost in the final image.Details
The following directives are currently in the base stage:
ENV CLP_HOME="/opt/clp"ENV PATH="${CLP_HOME}/bin:${PATH}"ENV PATH="${CLP_HOME}/sbin:${PATH}"ENV PYTHONPATH="${CLP_HOME}/lib/python3/site-packages"USER 1000:1000When the image is flattened with
FROM scratchfollowed byCOPY --from=base / /, these directives are not preserved in the final image metadata.Solution
These directives should be moved to after the
COPY --from=base / /command in the final stage to ensure they are present in the resulting image.References