From d5049239dc57a29f4e182533b28dbba8375dd237 Mon Sep 17 00:00:00 2001 From: Andrii Ostapenko Date: Mon, 17 May 2021 23:44:40 -0500 Subject: [PATCH] Allow to override default entrypoint for airshipctl image Change-Id: Ic1eb96fbc7c0a510d135c079ac94187a51087155 Signed-off-by: Andrii Ostapenko --- Dockerfile | 3 ++- Makefile | 3 +++ roles/airshipctl-build-images/tasks/main.yaml | 3 ++- roles/airshipctl-publish-images/tasks/main.yaml | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95b5a1f3a..39663b07d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,4 +37,5 @@ ARG BINARY=airshipctl ENV BINARY=${BINARY} COPY --from=builder /usr/src/airshipctl/bin/${BINARY} /usr/local/bin/${BINARY} USER 65534 -ENTRYPOINT /usr/local/bin/${BINARY} +ARG ENTRYPOINT=/usr/local/bin/${BINARY} +ENTRYPOINT ${ENTRYPOINT} diff --git a/Makefile b/Makefile index 40ea3aea0..3a84a8687 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,9 @@ endif ifneq ($(strip $(DOCKER_BASE_RELEASE_IMAGE)),) DOCKER_CMD_FLAGS += --build-arg RELEASE_IMAGE=$(strip $(DOCKER_BASE_RELEASE_IMAGE)) endif +ifneq ($(strip $(DOCKER_IMAGE_ENTRYPOINT)),) +DOCKER_CMD_FLAGS += --build-arg ENTRYPOINT=$(strip $(DOCKER_IMAGE_ENTRYPOINT)) +endif # use this variable for image labels added in internal build process COMMIT ?= $(shell git rev-parse HEAD) LABEL ?= org.airshipit.build=community diff --git a/roles/airshipctl-build-images/tasks/main.yaml b/roles/airshipctl-build-images/tasks/main.yaml index c76ab6e0b..c737e6495 100644 --- a/roles/airshipctl-build-images/tasks/main.yaml +++ b/roles/airshipctl-build-images/tasks/main.yaml @@ -10,7 +10,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Buid airshipctl Image +- name: Build airshipctl Image make: chdir: "{{ zuul.project.src_dir }}" target: images @@ -25,6 +25,7 @@ DOCKER_BASE_RELEASE_IMAGE: "{{ docker.base_release_image | default(omit) }}" DOCKER_BASE_PLUGINS_BUILD_IMAGE: "{{ docker.base_plugins_build_image | default(omit) }}" DOCKER_BASE_PLUGINS_RELEASE_IMAGE: "{{ docker.base_plugins_release_image | default(omit) }}" + DOCKER_IMAGE_ENTRYPOINT: "{{ docker.entrypoint | default(omit) }}" - name: Verify Image Exists shell: docker image inspect "$(make DOCKER_REGISTRY={{ image_repo }} DOCKER_IMAGE_PREFIX={{ image_prefix }} DOCKER_IMAGE_TAG={{ zuul.change }} print-docker-image-tag)" diff --git a/roles/airshipctl-publish-images/tasks/main.yaml b/roles/airshipctl-publish-images/tasks/main.yaml index 14701fbb8..9b6059717 100644 --- a/roles/airshipctl-publish-images/tasks/main.yaml +++ b/roles/airshipctl-publish-images/tasks/main.yaml @@ -43,6 +43,7 @@ DOCKER_BASE_RELEASE_IMAGE: "{{ docker.base_release_image | default(omit) }}" DOCKER_BASE_PLUGINS_BUILD_IMAGE: "{{ docker.base_plugins_build_image | default(omit) }}" DOCKER_BASE_PLUGINS_RELEASE_IMAGE: "{{ docker.base_plugins_release_image | default(omit) }}" + DOCKER_IMAGE_ENTRYPOINT: "{{ docker.entrypoint | default(omit) }}" target: images loop: - "latest"