Skip to content

Commit

Permalink
fix(docker): skip go-offline command when building images for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jul 8, 2024
1 parent 4f5efbc commit 3955f20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion build/full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ COPY ./ ./
RUN OS=${TARGETOS} ARCH=${TARGETARCH} make build

FROM --platform=${BUILDPLATFORM:-linux/amd64} flanksource/base-image:v0.2.0
ARG TARGETARCH

WORKDIR /app

ARG TARGETARCH
Expand Down Expand Up @@ -92,5 +94,9 @@ ENV PATH="${PATH}:/var/lib/canary/bin/"

COPY --from=builder /app/.bin/canary-checker /app

RUN /app/canary-checker go-offline
RUN if [ "$TARGETARCH" = "amd64" ]; then \
# This Docker image is built on an amd64 host
/app/canary-checker go-offline; \
fi

ENTRYPOINT ["/app/canary-checker"]
8 changes: 7 additions & 1 deletion build/minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ COPY ./ ./
RUN OS=${TARGETOS} ARCH=${TARGETARCH} make build

FROM --platform=${BUILDPLATFORM:-linux/amd64} flanksource/base-image:v0.2.0
ARG TARGETARCH

WORKDIR /app

RUN mkdir /opt/database && groupadd --gid 1000 canary && \
Expand All @@ -26,5 +28,9 @@ USER canary:canary

COPY --from=builder /app/.bin/canary-checker /app

RUN /app/canary-checker go-offline
RUN if [ "$TARGETARCH" = "amd64" ]; then \
# This Docker image is built on an amd64 host
/app/canary-checker go-offline; \
fi

ENTRYPOINT ["/app/canary-checker"]

0 comments on commit 3955f20

Please sign in to comment.