Skip to content

Commit 53d9bee

Browse files
author
Moritz Clasmeier
committed
dokcerfil
1 parent 6635a06 commit 53d9bee

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

Dockerfile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:1.25@s
2222
# && microdnf clean all \
2323
# && rm -rf /var/cache/yum
2424

25-
# Build arguments for cross-compilation.
26-
# These are automatically provided by Docker buildx.
2725
ARG TARGETOS
2826
ARG TARGETARCH
29-
ARG VERSION
30-
ARG BUILD_DATE
31-
ARG GIT_COMMIT
3227

3328
WORKDIR /build
3429

@@ -39,6 +34,18 @@ RUN go mod download
3934
# Copy source code
4035
COPY . .
4136

37+
# Build roxie binary with version info and cross-compilation support
38+
ARG VERSION
39+
ARG BUILD_DATE
40+
ARG GIT_COMMIT
41+
RUN CGO_ENABLED=0 \
42+
GOOS=${TARGETOS} \
43+
GOARCH=${TARGETARCH} \
44+
VERSION=${VERSION} \
45+
BUILD_DATE=${BUILD_DATE} \
46+
GIT_COMMIT=${GIT_COMMIT} \
47+
make build && cp /build/roxie /usr/local/bin/roxie
48+
4249
# Download gcloud SDK in builder stage to avoid UBI filesystem restrictions
4350
# Latest version including checksums can be found at:
4451
# https://docs.cloud.google.com/sdk/docs/install-sdk#linux
@@ -143,14 +150,6 @@ RUN ARCH=${TARGETARCH:-amd64} && \
143150
echo "${KUBECTL_SHA256} /usr/local/bin/kubectl" | sha256sum -c - && \
144151
chmod +x /usr/local/bin/kubectl
145152

146-
RUN CGO_ENABLED=0 \
147-
GOOS=${TARGETOS} \
148-
GOARCH=${TARGETARCH} \
149-
VERSION=${VERSION} \
150-
BUILD_DATE=${BUILD_DATE} \
151-
GIT_COMMIT=${GIT_COMMIT} \
152-
make build && cp /build/roxie /usr/local/bin/roxie
153-
154153
# Install roxctl - architecture-aware
155154
# The mirror has architecture-specific binaries: 'roxctl' (amd64) and 'roxctl-arm64'
156155
ARG ROXCTL_VERSION=4.10.0
@@ -181,7 +180,7 @@ RUN ARCH=${TARGETARCH:-amd64} && \
181180

182181
COPY scripts/roxcurl /usr/local/bin/roxcurl
183182

184-
RUN chown 1001:0 /usr/local/bin/* && chmod +x /usr/local/bin/*
183+
RUN chmod +x /usr/local/bin/*
185184

186185
# STAGE: builder-standard (based on builder-slim).
187186

0 commit comments

Comments
 (0)