Use 'release-linux-docker-<arch>' make target in multiarch Dockerfile

This commit is contained in:
Ralf Haferkamp
2025-02-26 12:48:07 +01:00
parent 1cc94879c2
commit 71c03e8ae6
2 changed files with 4 additions and 8 deletions
-6
View File
@@ -42,12 +42,6 @@ DEBUG_LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPol
DOCKER_LDFLAGS += -X "$(OC_REPO)/pkg/config/defaults.BaseDataPathType=path" -X "$(OC_REPO)/pkg/config/defaults.BaseDataPathValue=/var/lib/opencloud"
DOCKER_LDFLAGS += -X "$(OC_REPO)/pkg/config/defaults.BaseConfigPathType=path" -X "$(OC_REPO)/pkg/config/defaults.BaseConfigPathValue=/etc/opencloud"
# We can't link statically when vips is enabled but we still
# prefer static linking where possible
ifndef ENABLE_VIPS
DOCKER_LDFLAGS += -extldflags "-static"
endif
GCFLAGS += all=-N -l
.PHONY: all
+4 -2
View File
@@ -7,11 +7,13 @@ RUN apk add bash make git curl gcc musl-dev libc-dev binutils-gold inotify-tools
COPY ./ /opencloud/
WORKDIR /opencloud/opencloud
RUN GOOS="${TARGETOS:-linux}" GOARCH="${TARGETARCH:-amd64}" make ci-go-generate build ENABLE_VIPS=true
RUN GOOS="${TARGETOS:-linux}" GOARCH="${TARGETARCH:-amd64}" make ci-go-generate release-linux-docker-${TARGETARCH} ENABLE_VIPS=true
FROM alpine:3.20
ARG VERSION
ARG REVISION
ARG TARGETOS
ARG TARGETARCH
RUN apk add --no-cache attr bash ca-certificates curl inotify-tools libc6-compat mailcap tree vips patch && \
echo 'hosts: files dns' >| /etc/nsswitch.conf
@@ -48,4 +50,4 @@ EXPOSE 9200/tcp
ENTRYPOINT ["/usr/bin/opencloud"]
CMD ["server"]
COPY --from=build /opencloud/opencloud/bin/opencloud /usr/bin/opencloud
COPY --from=build /opencloud/opencloud/dist/binaries/opencloud-linux-${TARGETARCH} /usr/bin/opencloud