From 297c15de4b92425286cba2eb3977ec5d877a7e9a Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 17 Nov 2020 14:40:32 +0000 Subject: Remove footer block from intermediate images Only the final image in a hierarchy should have the footer block. neutron-infoblox-ipam-agent image still has two footers because it inherits from the neutron-server image. We set the user to root at the beginning of that Dockerfile, so that headers and footers have the right context. Change-Id: I95e5bb5583be2a76e289749e8adfc303a4e7197a (cherry picked from commit 4b792b9a43bee3bfb499cea14924527550f2bce0) --- docker/neutron/neutron-infoblox-ipam-agent/Dockerfile.j2 | 5 +++++ docker/neutron/neutron-server-opendaylight/Dockerfile.j2 | 3 +++ docker/neutron/neutron-server-ovn/Dockerfile.j2 | 3 +++ 3 files changed, 11 insertions(+) (limited to 'docker/neutron') diff --git a/docker/neutron/neutron-infoblox-ipam-agent/Dockerfile.j2 b/docker/neutron/neutron-infoblox-ipam-agent/Dockerfile.j2 index bc7dd9764..27c21fee1 100644 --- a/docker/neutron/neutron-infoblox-ipam-agent/Dockerfile.j2 +++ b/docker/neutron/neutron-infoblox-ipam-agent/Dockerfile.j2 @@ -1,6 +1,11 @@ FROM {{ namespace }}/{{ image_prefix }}neutron-server:{{ tag }} LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +# This image inherits from neutron-server image, which is also a leaf image, +# and therefore sets the user to neutron. Set the user to root, so that any +# headers or footers used have the right context. +USER root + {% block neutron_infoblox_ipam_agent_header %}{% endblock %} {% import "macros.j2" as macros with context %} diff --git a/docker/neutron/neutron-server-opendaylight/Dockerfile.j2 b/docker/neutron/neutron-server-opendaylight/Dockerfile.j2 index 287274a5e..b7a69e557 100644 --- a/docker/neutron/neutron-server-opendaylight/Dockerfile.j2 +++ b/docker/neutron/neutron-server-opendaylight/Dockerfile.j2 @@ -1,6 +1,9 @@ FROM {{ namespace }}/{{ image_prefix }}neutron-server:{{ tag }} LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +# This image inherits from neutron-server image, which is also a leaf image, +# and therefore sets the user to neutron. Set the user to root, so that any +# headers or footers used have the right context. USER root {% block neutron_server_opendaylight_header %}{% endblock %} diff --git a/docker/neutron/neutron-server-ovn/Dockerfile.j2 b/docker/neutron/neutron-server-ovn/Dockerfile.j2 index 6e2b10cb0..c6c070470 100644 --- a/docker/neutron/neutron-server-ovn/Dockerfile.j2 +++ b/docker/neutron/neutron-server-ovn/Dockerfile.j2 @@ -1,6 +1,9 @@ FROM {{ namespace }}/{{ image_prefix }}neutron-server:{{ tag }} LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +# This image inherits from neutron-server image, which is also a leaf image, +# and therefore sets the user to neutron. Set the user to root, so that any +# headers or footers used have the right context. USER root {% block neutron_server_ovn %}{% endblock %} -- cgit v1.2.3