diff --git a/.github/workflows/image-release.yaml b/.github/workflows/image-release.yml similarity index 97% rename from .github/workflows/image-release.yaml rename to .github/workflows/image-release.yml index 38b1c919..1286eec6 100644 --- a/.github/workflows/image-release.yaml +++ b/.github/workflows/image-release.yml @@ -16,8 +16,6 @@ jobs: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV echo "TAG=$(cat VERSION | cut -c 2-)" >> $GITHUB_ENV echo "ISO8601=$(LC_TIME=en_US.UTF-8 date "+%Y-%m-%dT%H:%M:%S%z")" >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Setup Jfrog diff --git a/Dockerfile b/Dockerfile index 26b96427..3a1c43af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,26 @@ -# syntax=docker/dockerfile:1.7-labs -FROM registry.access.redhat.com/ubi9:latest as base -RUN dnf -y install make git && dnf clean all - +# syntax=docker/dockerfile:1.12.0 ARG GO_VERSION=1.22.6 -WORKDIR /app +FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS builder -RUN arch=${TARGETARCH:-amd64} \ - && curl -Lo /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-${arch}.tar.gz" \ - && tar -xzf /tmp/go.tgz -C /usr/local/ \ - && rm /tmp/go.tgz +ARG TARGETOS +ARG TARGETARCH -FROM base as builder -ENV PATH="$PATH:/usr/local/go/bin" -ENV GOPATH=/app/aerospike-backup-service -ENV GOCACHE=/app/ +COPY --from=xx / / WORKDIR /app/aerospike-backup-service COPY . . -RUN make build +RUN <<-EOF + xx-go --wrap + OS=${TARGETOS} ARCH=${TARGETARCH} make build + xx-verify /app/aerospike-backup-service/build/target/aerospike-backup-service_${TARGETOS}_${TARGETARCH} +EOF FROM registry.access.redhat.com/ubi9/ubi-minimal:latest -COPY --from=builder /app/aerospike-backup-service/build/target/aerospike-backup-service /usr/bin/aerospike-backup-service +ARG TARGETOS +ARG TARGETARCH +COPY --from=builder /app/aerospike-backup-service/build/target/aerospike-backup-service_${TARGETOS}_${TARGETARCH} /usr/bin/aerospike-backup-service COPY --from=builder /app/aerospike-backup-service/config/config.yml /etc/aerospike-backup-service/aerospike-backup-service.yml EXPOSE 8080 diff --git a/VERSION b/VERSION index 6eaf8943..81ef58f2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0 \ No newline at end of file +v2.0.1 \ No newline at end of file diff --git a/build/scripts/docker-buildx.sh b/build/scripts/docker-buildx.sh index 060283d7..54689713 100755 --- a/build/scripts/docker-buildx.sh +++ b/build/scripts/docker-buildx.sh @@ -55,11 +55,6 @@ else fi docker login aerospike.jfrog.io -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" -docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -docker buildx rm builder || true - -docker buildx create --name builder --driver docker-container --use -docker buildx inspect --bootstrap PLATFORMS="$PLATFORMS" \ TAG="$TAG" \ @@ -70,9 +65,8 @@ GIT_COMMIT_SHA="$(git rev-parse HEAD)" \ VERSION="$(cat "$WORKSPACE/VERSION")" \ ISO8601="$(LC_TIME=en_US.UTF-8 date "+%Y-%m-%dT%H:%M:%S%z")" \ CONTEXT="$WORKSPACE" \ -docker buildx bake default \ +docker buildx bake \ +--allow=fs.read="$WORKSPACE" \ +default \ --progress plain \ --file "$WORKSPACE/build/docker-build/docker-bake.hcl" - -docker context use default -docker buildx rm builder diff --git a/docs/docs.go b/docs/docs.go index c180142a..7565d7b9 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2573,7 +2573,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "v2.0.0", + Version: "v2.0.1", Host: "localhost:8080", BasePath: "", Schemes: []string{}, diff --git a/docs/openapi.json b/docs/openapi.json index e61f5ad1..47945e1a 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -8,7 +8,7 @@ "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, "title" : "Backup Service REST API Specification", - "version" : "v2.0.0" + "version" : "v2.0.1" }, "externalDocs" : { "description" : "OpenAPI", diff --git a/docs/openapi.yaml b/docs/openapi.yaml index c14b3c00..3429789c 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -6,7 +6,7 @@ info: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: Backup Service REST API Specification - version: v2.0.0 + version: v2.0.1 externalDocs: description: OpenAPI url: https://swagger.io/resources/open-api/ diff --git a/internal/server/handlers/info.go b/internal/server/handlers/info.go index f1ec65de..c43e65d8 100644 --- a/internal/server/handlers/info.go +++ b/internal/server/handlers/info.go @@ -2,7 +2,7 @@ package handlers // Annotations to generate OpenAPI description (https://github.com/swaggo/swag) // @title Backup Service REST API Specification -// @version v2.0.0 +// @version v2.0.1 // @description Aerospike Backup Service // @license.name Apache 2.0 // @license.url http://www.apache.org/licenses/LICENSE-2.0.html