From 97babb2fad69bb86074eb6e7071b49e58a361946 Mon Sep 17 00:00:00 2001 From: Oleg Bulatov Date: Fri, 6 Oct 2023 16:02:43 +0200 Subject: [PATCH] WIP --- .env | 1 - Dockerfile | 5 +---- Dockerfile.online | 6 ++---- Makefile | 4 +--- cmd/install.go | 2 +- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.env b/.env index a0e1c1c8..08804028 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -EE_IMAGE=quay.io/quay/mirror-registry-ee:latest EE_BASE_IMAGE=registry.redhat.io/ansible-automation-platform-22/ee-minimal-rhel8:1.0.0-249 EE_BUILDER_IMAGE=registry.redhat.io/ansible-automation-platform-22/ansible-builder-rhel8:1.1.0-103 POSTGRES_IMAGE=registry.redhat.io/rhel8/postgresql-10:1-203.1669834630 diff --git a/Dockerfile b/Dockerfile index 51ef30f4..e5b56819 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ ARG RELEASE_VERSION=${RELEASE_VERSION} ARG QUAY_IMAGE=${QUAY_IMAGE} -ARG EE_IMAGE=${EE_IMAGE} ARG EE_BASE_IMAGE=${EE_BASE_IMAGE} ARG EE_BUILDER_IMAGE=${EE_BUILDER_IMAGE} ARG POSTGRES_IMAGE=${POSTGRES_IMAGE} @@ -13,7 +12,6 @@ FROM registry.access.redhat.com/ubi8:latest AS cli # Need to duplicate these, otherwise they won't be available to the stage ARG RELEASE_VERSION=${RELEASE_VERSION} ARG QUAY_IMAGE=${QUAY_IMAGE} -ARG EE_IMAGE=${EE_IMAGE} ARG POSTGRES_IMAGE=${POSTGRES_IMAGE} ARG REDIS_IMAGE=${REDIS_IMAGE} ARG PAUSE_IMAGE=${PAUSE_IMAGE} @@ -31,14 +29,13 @@ WORKDIR /cli # Create CLI ENV RELEASE_VERSION=${RELEASE_VERSION} -ENV EE_IMAGE=${EE_IMAGE} ENV QUAY_IMAGE=${QUAY_IMAGE} ENV REDIS_IMAGE=${REDIS_IMAGE} ENV POSTGRES_IMAGE=${POSTGRES_IMAGE} ENV PAUSE_IMAGE=${PAUSE_IMAGE} RUN go build -v \ - -ldflags "-X github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION} -X github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE} -X github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE} -X github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE} -X github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE} -X github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}" \ + -ldflags "-X github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION} -X github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE} -X github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE} -X github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE} -X github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}" \ -o mirror-registry # Create Ansible Execution Environment diff --git a/Dockerfile.online b/Dockerfile.online index 6b2f9857..c9a75418 100644 --- a/Dockerfile.online +++ b/Dockerfile.online @@ -8,7 +8,6 @@ FROM registry.redhat.io/ubi8:latest AS cli # Need to duplicate these, otherwise they won't be available to the stage ARG RELEASE_VERSION=${RELEASE_VERSION} ARG QUAY_IMAGE=${QUAY_IMAGE} -ARG EE_IMAGE=${EE_IMAGE} ARG POSTGRES_IMAGE=${POSTGRES_IMAGE} ARG REDIS_IMAGE=${REDIS_IMAGE} ARG PAUSE_IMAGE=${PAUSE_IMAGE} @@ -26,14 +25,13 @@ WORKDIR /cli # Create CLI ENV RELEASE_VERSION=${RELEASE_VERSION} -ENV EE_IMAGE=${EE_IMAGE} ENV QUAY_IMAGE=${QUAY_IMAGE} ENV REDIS_IMAGE=${REDIS_IMAGE} ENV POSTGRES_IMAGE=${POSTGRES_IMAGE} ENV PAUSE_IMAGE=${PAUSE_IMAGE} RUN go build -v \ - -ldflags "-X github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION} -X github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE} -X github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE} -X github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE} -X github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE} -X github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}" \ + -ldflags "-X github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION} -X github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE} -X github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE} -X github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE} -X github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}" \ -o mirror-registry # Create Ansible Execution Environment @@ -77,4 +75,4 @@ RUN tar -czvf mirror-registry.tar.gz execution-environment.tar mirror-registry # Extract bundle to final release image FROM registry.redhat.io/ubi8:latest AS release -COPY --from=build mirror-registry.tar.gz mirror-registry.tar.gz \ No newline at end of file +COPY --from=build mirror-registry.tar.gz mirror-registry.tar.gz diff --git a/Makefile b/Makefile index 331b6f8e..aa8d87d8 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ all: build-golang-executable: $(CLIENT) run --rm -v ${PWD}:/usr/src:Z -w /usr/src docker.io/golang:1.16 go build -v \ - -ldflags "-X github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE} -X 'github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}'" \ + -ldflags "-X 'github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}'" \ -o mirror-registry; build-online-zip: @@ -14,7 +14,6 @@ build-online-zip: -t mirror-registry-online:${RELEASE_VERSION} \ --build-arg RELEASE_VERSION=${RELEASE_VERSION} \ --build-arg QUAY_IMAGE=${QUAY_IMAGE} \ - --build-arg EE_IMAGE=${EE_IMAGE} \ --build-arg EE_BASE_IMAGE=${EE_BASE_IMAGE} \ --build-arg EE_BUILDER_IMAGE=${EE_BUILDER_IMAGE} \ --build-arg POSTGRES_IMAGE=${POSTGRES_IMAGE} \ @@ -30,7 +29,6 @@ build-offline-zip: -t mirror-registry-offline:${RELEASE_VERSION} \ --build-arg RELEASE_VERSION=${RELEASE_VERSION} \ --build-arg QUAY_IMAGE=${QUAY_IMAGE} \ - --build-arg EE_IMAGE=${EE_IMAGE} \ --build-arg EE_BASE_IMAGE=${EE_BASE_IMAGE} \ --build-arg EE_BUILDER_IMAGE=${EE_BUILDER_IMAGE} \ --build-arg POSTGRES_IMAGE=${POSTGRES_IMAGE} \ diff --git a/cmd/install.go b/cmd/install.go index e3052abe..9d9e0d8d 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -16,7 +16,7 @@ import ( ) // These variables are set at build time via ldflags -var eeImage string +var eeImage string = "REMOVEME" var pauseImage string var quayImage string var redisImage string