From 0ec37df1e4120fbcf6511268035fefea1dd877c1 Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Tue, 20 Sep 2022 11:14:25 +0200 Subject: [PATCH] Container build: define ARGs after FROM line According to the Dockerfile reference[1], ARG instructions before the FROM line are a special case: variables defined in this way are only available in the FROM line and not during the rest of the build. In order for defined ARGs to be available during image build time we must run these after the FROM line. [1] https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/858864 Signed-off-by: Miguel Garcia Change-Id: I8086b7820ff2d124baacbe8e947aba970996b907 --- .../tripleo_container_image_build/templates/Containerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleo_ansible/roles/tripleo_container_image_build/templates/Containerfile.j2 b/tripleo_ansible/roles/tripleo_container_image_build/templates/Containerfile.j2 index b4d45f120..64731a1a9 100644 --- a/tripleo_ansible/roles/tripleo_container_image_build/templates/Containerfile.j2 +++ b/tripleo_ansible/roles/tripleo_container_image_build/templates/Containerfile.j2 @@ -13,10 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. +FROM {{ tcib_from }} {% for key, value in tcib_args.items() %} ARG {{ key }}={{ value | to_json }} {% endfor %} -FROM {{ tcib_from }} {% for key, value in tcib_labels.items() %} LABEL {{ key }}={{ value | to_json }} {% endfor %}