Skip to content

Commit

Permalink
Revert "Add multi-arch docker image build support"
Browse files Browse the repository at this point in the history
This reverts commit 9fa50b2.

Pushing of ARM images is not working[1], and there are issues with
pushing master images[2].

Rather than deal with risky fixes with buildx days before the v0.45.0
release, we've decided to roll back this change and migrate to buildx
later, once we've understood and tested the build process better.

[1]: #3015 (comment)

[2]: #3127
  • Loading branch information
Ivan Mirić authored and imiric committed Jun 16, 2023
1 parent 9e48c38 commit a0c43b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,7 @@ jobs:
with:
fetch-depth: 0
- name: Build
run: |
docker buildx create \
--name multibuilder \
--platform linux/amd64,linux/arm64 \
--bootstrap --use
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t $DOCKER_IMAGE_ID .
run: docker build -t $DOCKER_IMAGE_ID .
- name: Check
run: |
docker run $DOCKER_IMAGE_ID version
Expand Down
16 changes: 3 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
# syntax=docker/dockerfile:1
# Build
FROM --platform=$BUILDPLATFORM golang:1.20-alpine3.17 AS builder

ARG TARGETOS TARGETARCH

ENV GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
CGO_ENABLED=0

FROM golang:1.20-alpine3.17 as builder
WORKDIR $GOPATH/src/go.k6.io/k6
COPY . .
RUN apk --no-cache add git=~2
RUN go build -a -trimpath -ldflags "-s -w -X go.k6.io/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --tags --always --long --dirty)" -o /usr/bin/k6 .
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X go.k6.io/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --tags --always --long --dirty)"

# Runtime stage
FROM alpine:3.17
# hadolint ignore=DL3018
RUN apk add --no-cache ca-certificates && \
adduser -D -u 12345 -g 12345 k6
COPY --from=builder /usr/bin/k6 /usr/bin/k6
COPY --from=builder /go/bin/k6 /usr/bin/k6

USER 12345
WORKDIR /home/k6
Expand Down

0 comments on commit a0c43b8

Please sign in to comment.