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"