Bug 2128230 - Dockerfile ARG command before FROM line breaks downstream container builds
Summary: Dockerfile ARG command before FROM line breaks downstream container builds
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-containers
Version: 17.1 (Wallaby)
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Miguel Garcia
QA Contact: Arik Chernetsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-20 09:47 UTC by Miguel Garcia
Modified: 2022-09-26 14:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-26 14:42:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 858508 0 None NEW Container build: define ARGs after FROM line 2022-09-22 08:20:14 UTC
OpenStack gerrit 858515 0 None MERGED Add support for tcib_extra_config for master branch only 2022-09-22 10:23:17 UTC
OpenStack gerrit 858864 0 None NEW Drop ANSIBLE_RUNNER_IMAGE from tcib_args 2022-09-22 10:24:56 UTC
Red Hat Issue Tracker OSP-18788 0 None None None 2022-09-20 09:52:56 UTC

Description Miguel Garcia 2022-09-20 09:47:35 UTC
Dockerfile changes introduced in the latest 17.1 promotion from wallaby:
https://pkgs.devel.redhat.com/cgit/containers/openstack-base/commit/?h=rhos-17.1-rhel-9&id=fe85878cf7043211d66af5dd81df585bf30d5afc

+ARG ANSIBLE_RUNNER_IMAGE="quay.io/tripleoansible/ansible-runner:stream9"
+ARG TRIPLEO_ANSIBLE_REQ="/usr/share/openstack-tripleo-common-containers/container-images/kolla/tripleo-ansible-ee/requirements.yaml"
 FROM registry.access.redhat.com/ubi9:9.0.0

Cause downstream container builds to break because the use of ARG commands before the FROM command is not supported:
2022-09-19 09:32:37,695 - atomic_reactor.util - DEBUG - Step 1/50 : ARG ANSIBLE_RUNNER_IMAGE="quay.io/tripleoansible/ansible-runner:stream9"
2022-09-19 09:32:37,696 - atomic_reactor.util - ERROR - {'errorDetail': {'message': 'Please provide a source image with `from` prior to commit'}, 'error': 'Please provide a source image with `from` prior to commit'}

Another matter is that those variables shouldn't show up in all container images as they do now: they're supposed to be just for the new tripleo-ansible-ee container that hasn't been backported to wallaby just yet.

Related changes leading up to this:
https://review.opendev.org/c/openstack/tripleo-common/+/776674
https://review.opendev.org/c/openstack/tripleo-ci/+/850736

It appears that a quick solution would be to revert the above tripleo-ci change, like so:
https://review.opendev.org/c/openstack/tripleo-ci/+/857776

While a proper solution might be to:
1) Have tripleo-ansible put those ARGs after the FROM line. Change proposed: https://review.opendev.org/c/openstack/tripleo-ansible/+/858508

2) Have tripleo-common's tripleo-ansible-ee base image definition not rely on the old (broken) order of operations, as it does now:
https://opendev.org/openstack/tripleo-common/src/commit/04a69b47318e9c75f1d5c10089531a479517f465/container-images/tcib/tripleo-ansible-ee/tripleo-ansible-ee.yaml#L4

3) Fix tripleo-ci to have those extra_configs be added only to relevant images, instead of all of them as it does now:
https://review.opendev.org/c/openstack/tripleo-ci/+/850736


Note You need to log in before you can comment on or make changes to this bug.