From ae263311a9550e314d98f8be21f403d4dabfd73f Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Tue, 8 Oct 2024 01:42:54 -0300 Subject: [PATCH] Build multiplatform images with docker compose build --- .github/workflows/build-and-push.yaml | 32 +++++--- Makefile | 79 +++++++++++++------ README.md | 36 +++++++-- docker-build/.env | 2 + docker-build/base-images-multiplatform.yml | 26 ++++++ docker-build/base-images.yml | 25 +++--- docker-build/geoserver-multiplatform.yml | 58 ++++++++++++++ docker-build/geoserver.yml | 64 +++++++-------- docker-build/infrastructure-multiplatform.yml | 32 ++++++++ docker-build/infrastructure.yml | 32 ++++---- docker-build/templates.yml | 22 ++++++ src/apps/base-images/geoserver/Dockerfile | 6 +- src/apps/base-images/spring-boot/Dockerfile | 7 +- src/apps/geoserver/gwc/Dockerfile | 6 +- src/apps/geoserver/restconfig/Dockerfile | 6 +- src/apps/geoserver/wcs/Dockerfile | 6 +- src/apps/geoserver/webui/Dockerfile | 6 +- src/apps/geoserver/wfs/Dockerfile | 6 +- src/apps/geoserver/wms/Dockerfile | 6 +- src/apps/geoserver/wps/Dockerfile | 6 +- src/apps/infrastructure/admin/Dockerfile | 6 +- src/apps/infrastructure/config/Dockerfile | 6 +- src/apps/infrastructure/discovery/Dockerfile | 6 +- src/apps/infrastructure/gateway/Dockerfile | 6 +- 24 files changed, 356 insertions(+), 131 deletions(-) create mode 100644 docker-build/.env create mode 100644 docker-build/base-images-multiplatform.yml create mode 100644 docker-build/geoserver-multiplatform.yml create mode 100644 docker-build/infrastructure-multiplatform.yml create mode 100644 docker-build/templates.yml diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index 9e35e81fc..f29b3d025 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -22,15 +22,25 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - name: Install Cosign - uses: sigstore/cosign-installer@v3.5.0 - - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + # Add support for more platforms with QEMU + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # https://github.com/docker/setup-buildx-action + with: + platforms: linux/amd64,linux/arm64 + # Sets up docker build command as an alias to docker buildx + install: true + - name: Checkout uses: actions/checkout@v4 with: @@ -43,23 +53,23 @@ jobs: java-version: '21' cache: 'maven' - - name: Build without tests + - name: Build application packages run: | - make install + make package - - name: Build images + - name: Build and push images run: | - make build-image - - - name: Push images - run: | - make push-image + REPACKAGE=false make build-image-multiplatform - name: Remove project jars from cached repository run: | rm -rf ~/.m2/repository/org/geoserver find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} + - name: Install Cosign + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: sigstore/cosign-installer@v3.5.0 + - name: Sign images if: ${{ startsWith(github.ref, 'refs/tags/') }} env: diff --git a/Makefile b/Makefile index 1d7cc24a6..73fe49732 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ all: install test build-image TAG=$(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + COSIGN_PASSWORD := $(COSIGN_PASSWORD) COMPOSE_PGCONFIG_OPTIONS ?= -f compose.yml -f catalog-pgconfig.yml COMPOSE_DATADIR_OPTIONS ?= -f compose.yml -f catalog-datadir.yml @@ -10,6 +11,8 @@ COMPOSE_ACCEPTANCE_DATADIR_OPTIONS ?= --project-name gscloud-acceptance-datadir UID=$(shell id -u) GID=$(shell id -g) +REPACKAGE ?= true + .PHONY: clean clean: ./mvnw clean @@ -26,44 +29,76 @@ format: install: ./mvnw clean install -DskipTests -ntp -T4 -U +.PHONY: package +package: + ./mvnw clean package -DskipTests -ntp -T4 -U + .PHONY: test test: ./mvnw verify -ntp -T4 +.PHONY: build-image +build-image: build-base-images build-image-infrastructure build-image-geoserver + .PHONY: build-base-images -build-base-images: - ./mvnw clean package -f src/apps/base-images -DskipTests -T4 && \ - COMPOSE_DOCKER_CLI_BUILD=1 \ - DOCKER_BUILDKIT=1 \ - TAG=$(TAG) \ - docker compose -f docker-build/base-images.yml build +build-base-images: package-base-images + TAG=$(TAG) docker compose -f docker-build/base-images.yml build .PHONY: build-image-infrastructure -build-image-infrastructure: - ./mvnw clean package -f src/apps/infrastructure -DskipTests -T4 && \ +build-image-infrastructure: package-infrastructure-images + TAG=$(TAG) docker compose -f docker-build/infrastructure.yml build + +.PHONY: build-image-geoserver +build-image-geoserver: package-geoserver-images + TAG=$(TAG) docker compose -f docker-build/geoserver.yml build + +.PHONY: build-image-multiplatform +build-image-multiplatform: build-base-images-multiplatform build-image-infrastructure-multiplatform build-image-geoserver-multiplatform + +.PHONY: build-base-images-multiplatform +build-base-images-multiplatform: package-base-images COMPOSE_DOCKER_CLI_BUILD=1 \ DOCKER_BUILDKIT=1 \ TAG=$(TAG) \ - docker compose -f docker-build/infrastructure.yml build + docker compose -f docker-build/base-images-multiplatform.yml build --push -.PHONY: build-image-geoserver -build-image-geoserver: - ./mvnw clean package -f src/apps/geoserver -DskipTests -T4 && \ +.PHONY: build-image-infrastructure-multiplatform +build-image-infrastructure-multiplatform: package-infrastructure-images COMPOSE_DOCKER_CLI_BUILD=1 \ DOCKER_BUILDKIT=1 \ TAG=$(TAG) \ - docker compose -f docker-build/geoserver.yml build + docker compose -f docker-build/infrastructure-multiplatform.yml build --push -.PHONY: build-image -build-image: build-base-images build-image-infrastructure build-image-geoserver - -.PHONY: push-image -push-image: +.PHONY: build-image-geoserver-multiplatform +build-image-geoserver-multiplatform: package-geoserver-images + COMPOSE_DOCKER_CLI_BUILD=1 \ + DOCKER_BUILDKIT=1 \ TAG=$(TAG) \ - docker compose \ - -f docker-build/infrastructure.yml \ - -f docker-build/geoserver.yml \ - push + docker compose -f docker-build/geoserver-multiplatform.yml build --push + +.PHONY: package-base-images +package-base-images: +ifeq ($(REPACKAGE), true) + ./mvnw clean package -f src/apps/base-images -DskipTests -T4 +else + @echo "Not re-packaging base images, assuming the target/*-bin.jar files exist" +endif + +.PHONY: package-infrastructure-images +package-infrastructure-images: +ifeq ($(REPACKAGE), true) + ./mvnw clean package -f src/apps/infrastructure -DskipTests -T4 +else + @echo "Not re-packaging infra images, assuming the target/*-bin.jar files exist" +endif + +.PHONY: package-geoserver-images +package-geoserver-images: +ifeq ($(REPACKAGE), true) + ./mvnw clean package -f src/apps/geoserver -DskipTests -T4 +else + @echo "Not re-packaging geoserver images, assuming the target/*-bin.jar files exist" +endif .PHONY: sign-image sign-image: diff --git a/README.md b/README.md index 73f2e6b06..154a8ce2b 100644 --- a/README.md +++ b/README.md @@ -141,29 +141,49 @@ which you can also run individually during development depending on your needs. you'd run `make build-image-geoserver` to speed up the process when made a change and want to test the geoserver containers, without having to rebuild the base and infra images. -### Targeted builds +#### Multiplatform (amd64/arm64) images -*GeoServer Cloud*-specific modules source code is under the `src/` directory. +The "build and push" github actions job will create `linux/amd64` and `linux/arm64` multi-platform images by running -When you already have the `2.23.0-CLOUD` GeoServer artifacts, you can choose to only build these projects, either by: +```bash +make build-image-multiplatform +``` + +This target assumes `buildx` is set up as an alias for `docker build` and there's a build runner that supports both platforms. +Building multi-platform images requires pushing to the container registry, so the `build-image-multiplatform` target +will run `docker compose build --push` with the appropriate `*-multiplatform.yml` compose file from the `docker-build` directory. + +If you want to build the multi-platform images yourself: + +* Install QEmu +* Run the following command to create a `buildx` builder: ```bash -$ ./mvnw clean install -f src/ +docker buildx create --name gscloud-builder --driver docker-container --bootstrap --use ``` -Or +In order to push the images to your own dockerhub account, use the `RESPOSITORY` environment variable, for example: + +```bash +REPOSITORY=groldan make build-image-multiplatform +``` + +will build and push `groldan/:` tagged images instead of the default `geoservercloud/:` ones. + + +Finally, to remove the multi-platform builder, run ```bash -$ cd src/ -$ ../mvnw clean install +docker buildx stop gscloud-builder +docker buildx rm gscloud-builder ``` ### Note on custom upstream GeoServer version *GeoServer Cloud* depends on a custom GeoServer branch, `gscloud/gs_version/integration`, which contains patches to upstream GeoServer that have not yet been integrated into the mainstream `main` branch. -Additionally, this branch changes the artifact versions (e.g. from `2.23-SNAPSHOT` to `2.23.0-CLOUD`), to avoid confusing maven if you also work with vanilla GeoServer, and to avoid your IDE downloading the latest `2.23-SNAPSHOT` artifacts from the OsGeo maven repository, overriding your local maven repository ones, and having confusing compilation errors that would require re-building the branch we need. +Additionally, this branch changes the artifact versions (e.g. from `2.26.0` to `2.26.0.0`), to avoid confusing maven if you also work with vanilla GeoServer, and to avoid your IDE downloading the latest `2.23-SNAPSHOT` artifacts from the OsGeo maven repository, overriding your local maven repository ones, and having confusing compilation errors that would require re-building the branch we need. The `gscloud/gs_version/integration` branch is checked out as a submodule on the [camptocamp/geoserver-cloud-geoserver](https://github.com/camptocamp/geoserver-cloud-geoserver) repository, which publishes the custom geoserver maven artifacts to the Github maven package registry. diff --git a/docker-build/.env b/docker-build/.env new file mode 100644 index 000000000..e032e4a91 --- /dev/null +++ b/docker-build/.env @@ -0,0 +1,2 @@ +REPOSITORY=geoservercloud + diff --git a/docker-build/base-images-multiplatform.yml b/docker-build/base-images-multiplatform.yml new file mode 100644 index 000000000..58d728caa --- /dev/null +++ b/docker-build/base-images-multiplatform.yml @@ -0,0 +1,26 @@ +services: + base-image-jre: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/gs-cloud-base-jre:${TAG} + build: + context: ../src/apps/base-images/jre/ + + base-image-spring-boot: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/gs-cloud-base-spring-boot:${TAG} + depends_on: [base-image-jre] + build: + context: ../src/apps/base-images/spring-boot/ + + base-image-geoserver: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/gs-cloud-base-geoserver-image:${TAG} + depends_on: [base-image-spring-boot] + build: + context: ../src/apps/base-images/geoserver/ diff --git a/docker-build/base-images.yml b/docker-build/base-images.yml index d6c62009e..bf51d8a90 100644 --- a/docker-build/base-images.yml +++ b/docker-build/base-images.yml @@ -1,27 +1,26 @@ services: base-image-jre: - image: geoservercloud/gs-cloud-base-jre:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/gs-cloud-base-jre:${TAG} build: - no_cache: true - pull: true context: ../src/apps/base-images/jre/ base-image-spring-boot: - image: geoservercloud/gs-cloud-base-spring-boot:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/gs-cloud-base-spring-boot:${TAG} depends_on: [base-image-jre] build: - no_cache: true - pull: false context: ../src/apps/base-images/spring-boot/ - args: - TAG: ${TAG} base-image-geoserver: - image: geoservercloud/gs-cloud-base-geoserver-image:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/gs-cloud-base-geoserver-image:${TAG} depends_on: [base-image-spring-boot] build: - no_cache: true - pull: false context: ../src/apps/base-images/geoserver/ - args: - TAG: ${TAG} diff --git a/docker-build/geoserver-multiplatform.yml b/docker-build/geoserver-multiplatform.yml new file mode 100644 index 000000000..a1cf5ec3b --- /dev/null +++ b/docker-build/geoserver-multiplatform.yml @@ -0,0 +1,58 @@ +services: + wfs: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-wfs:${TAG} + build: + context: ../src/apps/geoserver/wfs/ + + wms: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-wms:${TAG} + build: + context: ../src/apps/geoserver/wms/ + + wcs: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-wcs:${TAG} + build: + context: ../src/apps/geoserver/wcs/ + + wps: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-wps:${TAG} + build: + context: ../src/apps/geoserver/wps/ + + rest: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-rest:${TAG} + build: + context: ../src/apps/geoserver/restconfig/ + + webui: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-webui:${TAG} + build: + context: ../src/apps/geoserver/webui/ + + gwc: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-gwc:${TAG} + build: + context: ../src/apps/geoserver/gwc/ + + \ No newline at end of file diff --git a/docker-build/geoserver.yml b/docker-build/geoserver.yml index 5b8fec745..9f663661b 100644 --- a/docker-build/geoserver.yml +++ b/docker-build/geoserver.yml @@ -1,64 +1,58 @@ services: wfs: - image: geoservercloud/geoserver-cloud-wfs:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-wfs:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/wfs/ - args: - TAG: ${TAG} wms: - image: geoservercloud/geoserver-cloud-wms:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-wms:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/wms/ - args: - TAG: ${TAG} wcs: - image: geoservercloud/geoserver-cloud-wcs:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-wcs:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/wcs/ - args: - TAG: ${TAG} wps: - image: geoservercloud/geoserver-cloud-wps:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-wps:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/wps/ - args: - TAG: ${TAG} rest: - image: geoservercloud/geoserver-cloud-rest:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-rest:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/restconfig/ - args: - TAG: ${TAG} webui: - image: geoservercloud/geoserver-cloud-webui:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-webui:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/webui/ - args: - TAG: ${TAG} gwc: - image: geoservercloud/geoserver-cloud-gwc:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-gwc:${TAG} build: - no_cache: true - pull: false context: ../src/apps/geoserver/gwc/ - args: - TAG: ${TAG} + \ No newline at end of file diff --git a/docker-build/infrastructure-multiplatform.yml b/docker-build/infrastructure-multiplatform.yml new file mode 100644 index 000000000..b3eb1ad60 --- /dev/null +++ b/docker-build/infrastructure-multiplatform.yml @@ -0,0 +1,32 @@ +services: + discovery: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-discovery:${TAG} + build: + context: ../src/apps/infrastructure/discovery/ + + config: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-config:${TAG} + build: + context: ../src/apps/infrastructure/config/ + + admin: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-admin-server:${TAG} + build: + context: ../src/apps/infrastructure/admin/ + + gateway: + extends: + file: templates.yml + service: multi-platform + image: ${REPOSITORY}/geoserver-cloud-gateway:${TAG} + build: + context: ../src/apps/infrastructure/gateway/ diff --git a/docker-build/infrastructure.yml b/docker-build/infrastructure.yml index ce1b03c39..35138daad 100644 --- a/docker-build/infrastructure.yml +++ b/docker-build/infrastructure.yml @@ -1,32 +1,32 @@ services: discovery: - image: geoservercloud/geoserver-cloud-discovery:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-discovery:${TAG} build: - no_cache: true context: ../src/apps/infrastructure/discovery/ - args: - TAG: ${TAG} config: - image: geoservercloud/geoserver-cloud-config:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-config:${TAG} build: - no_cache: true context: ../src/apps/infrastructure/config/ - args: - TAG: ${TAG} admin: - image: geoservercloud/geoserver-cloud-admin-server:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-admin-server:${TAG} build: - no_cache: true context: ../src/apps/infrastructure/admin/ - args: - TAG: ${TAG} gateway: - image: geoservercloud/geoserver-cloud-gateway:${TAG} + extends: + file: templates.yml + service: current-platform + image: ${REPOSITORY}/geoserver-cloud-gateway:${TAG} build: - no_cache: true context: ../src/apps/infrastructure/gateway/ - args: - TAG: ${TAG} diff --git a/docker-build/templates.yml b/docker-build/templates.yml new file mode 100644 index 000000000..f3a42495a --- /dev/null +++ b/docker-build/templates.yml @@ -0,0 +1,22 @@ +services: + current-platform: + build: + no_cache: true + pull: true + context: override-me + args: + TAG: ${TAG} + REPOSITORY: ${REPOSITORY} + + multi-platform: + build: + no_cache: true + pull: true + context: override-me + platforms: + - linux/amd64 + - linux/arm64 + args: + TAG: ${TAG} + REPOSITORY: ${REPOSITORY} + \ No newline at end of file diff --git a/src/apps/base-images/geoserver/Dockerfile b/src/apps/base-images/geoserver/Dockerfile index fd8c90713..be7c14730 100644 --- a/src/apps/base-images/geoserver/Dockerfile +++ b/src/apps/base-images/geoserver/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG AS builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG AS builder ARG JAR_FILE=target/gs-cloud-*-bin.jar RUN apt update && apt install -y --no-install-recommends unzip @@ -13,7 +15,7 @@ RUN java -Djarmode=layertools -jar application.jar extract # rm /tmp/YourKit-JavaProfiler-2023.9-docker.zip ########## -FROM geoservercloud/gs-cloud-base-spring-boot:$TAG +FROM $REPOSITORY/gs-cloud-base-spring-boot:$TAG # init RUN apt update \ diff --git a/src/apps/base-images/spring-boot/Dockerfile b/src/apps/base-images/spring-boot/Dockerfile index eb2f8e73d..dba590c12 100644 --- a/src/apps/base-images/spring-boot/Dockerfile +++ b/src/apps/base-images/spring-boot/Dockerfile @@ -1,5 +1,8 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG AS builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG AS builder + ARG JAR_FILE=target/gs-cloud-*-bin.jar COPY ${JAR_FILE} application.jar @@ -7,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-jre:$TAG +FROM $REPOSITORY/gs-cloud-base-jre:$TAG COPY target/config/ /etc/geoserver/ diff --git a/src/apps/geoserver/gwc/Dockerfile b/src/apps/geoserver/gwc/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/gwc/Dockerfile +++ b/src/apps/geoserver/gwc/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/geoserver/restconfig/Dockerfile b/src/apps/geoserver/restconfig/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/restconfig/Dockerfile +++ b/src/apps/geoserver/restconfig/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/geoserver/wcs/Dockerfile b/src/apps/geoserver/wcs/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/wcs/Dockerfile +++ b/src/apps/geoserver/wcs/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/geoserver/webui/Dockerfile b/src/apps/geoserver/webui/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/webui/Dockerfile +++ b/src/apps/geoserver/webui/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/geoserver/wfs/Dockerfile b/src/apps/geoserver/wfs/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/wfs/Dockerfile +++ b/src/apps/geoserver/wfs/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/geoserver/wms/Dockerfile b/src/apps/geoserver/wms/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/wms/Dockerfile +++ b/src/apps/geoserver/wms/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/geoserver/wps/Dockerfile b/src/apps/geoserver/wps/Dockerfile index 0d942b6ba..851d7cbb6 100644 --- a/src/apps/geoserver/wps/Dockerfile +++ b/src/apps/geoserver/wps/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG as builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG as builder ARG JAR_FILE=target/gs-cloud-*-bin.jar @@ -8,7 +10,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG +FROM $REPOSITORY/gs-cloud-base-geoserver-image:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/infrastructure/admin/Dockerfile b/src/apps/infrastructure/admin/Dockerfile index 09466ba45..2e6762f69 100644 --- a/src/apps/infrastructure/admin/Dockerfile +++ b/src/apps/infrastructure/admin/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG AS builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG AS builder ARG JAR_FILE=target/gs-cloud-*-bin.jar COPY ${JAR_FILE} application.jar @@ -7,7 +9,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-spring-boot:$TAG +FROM $REPOSITORY/gs-cloud-base-spring-boot:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/infrastructure/config/Dockerfile b/src/apps/infrastructure/config/Dockerfile index 17d3ef2e1..0c1a0e3fb 100644 --- a/src/apps/infrastructure/config/Dockerfile +++ b/src/apps/infrastructure/config/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG AS builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG AS builder ARG JAR_FILE=target/gs-cloud-*-bin.jar COPY ${JAR_FILE} application.jar @@ -7,7 +9,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-spring-boot:$TAG +FROM $REPOSITORY/gs-cloud-base-spring-boot:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/infrastructure/discovery/Dockerfile b/src/apps/infrastructure/discovery/Dockerfile index 99ea6199c..d16b5892c 100644 --- a/src/apps/infrastructure/discovery/Dockerfile +++ b/src/apps/infrastructure/discovery/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG AS builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG AS builder ARG JAR_FILE=target/gs-cloud-*-bin.jar COPY ${JAR_FILE} application.jar @@ -7,7 +9,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-spring-boot:$TAG +FROM $REPOSITORY/gs-cloud-base-spring-boot:$TAG # WORKDIR already set to /opt/app/bin diff --git a/src/apps/infrastructure/gateway/Dockerfile b/src/apps/infrastructure/gateway/Dockerfile index 99ea6199c..d16b5892c 100644 --- a/src/apps/infrastructure/gateway/Dockerfile +++ b/src/apps/infrastructure/gateway/Dockerfile @@ -1,5 +1,7 @@ +ARG REPOSITORY=geoservercloud ARG TAG=latest -FROM geoservercloud/gs-cloud-base-jre:$TAG AS builder + +FROM $REPOSITORY/gs-cloud-base-jre:$TAG AS builder ARG JAR_FILE=target/gs-cloud-*-bin.jar COPY ${JAR_FILE} application.jar @@ -7,7 +9,7 @@ COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract ########## -FROM geoservercloud/gs-cloud-base-spring-boot:$TAG +FROM $REPOSITORY/gs-cloud-base-spring-boot:$TAG # WORKDIR already set to /opt/app/bin