From 422f3f2527598c65335f7d14fc7b10d4e27a8534 Mon Sep 17 00:00:00 2001 From: Paul DeCarlo Date: Sat, 2 Jun 2018 05:26:47 +0000 Subject: [PATCH 1/4] Add Dockerfile.arm32v6 --- Dockerfile.arm32v6 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile.arm32v6 diff --git a/Dockerfile.arm32v6 b/Dockerfile.arm32v6 new file mode 100644 index 00000000..a728a084 --- /dev/null +++ b/Dockerfile.arm32v6 @@ -0,0 +1,22 @@ +# builder image +FROM arm32v6/golang:1.10-alpine3.7 as builder + +RUN apk --no-cache add git +RUN go get github.com/golang/dep/cmd/dep +WORKDIR /go/src/github.com/linki/chaoskube +COPY . . +RUN dep ensure -vendor-only +RUN go test -v ./... +RUN go build -o /bin/chaoskube -v \ + -ldflags "-X main.version=$(git describe --tags --always --dirty) -w -s" + +# final image +FROM arm32v6/alpine:3.7 +MAINTAINER Linki + +RUN apk --no-cache add ca-certificates dumb-init tzdata +RUN addgroup -S chaoskube && adduser -S -g chaoskube chaoskube +COPY --from=builder /bin/chaoskube /bin/chaoskube + +USER chaoskube +ENTRYPOINT ["dumb-init", "--", "/bin/chaoskube"] From c00aa4f6d6f0486d250878c59866f7f66ee144ea Mon Sep 17 00:00:00 2001 From: Paul DeCarlo Date: Sat, 2 Jun 2018 13:05:06 -0500 Subject: [PATCH 2/4] Cross-Compile to arm from x86 image --- Dockerfile.arm32v6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.arm32v6 b/Dockerfile.arm32v6 index a728a084..de80d6ac 100644 --- a/Dockerfile.arm32v6 +++ b/Dockerfile.arm32v6 @@ -1,5 +1,5 @@ # builder image -FROM arm32v6/golang:1.10-alpine3.7 as builder +FROM golang:1.10-alpine3.7 as builder RUN apk --no-cache add git RUN go get github.com/golang/dep/cmd/dep @@ -7,7 +7,7 @@ WORKDIR /go/src/github.com/linki/chaoskube COPY . . RUN dep ensure -vendor-only RUN go test -v ./... -RUN go build -o /bin/chaoskube -v \ +RUN GOARCH=arm go build -o /bin/chaoskube -v \ -ldflags "-X main.version=$(git describe --tags --always --dirty) -w -s" # final image From 63000c666e587dba8227e661848f73dc87517b33 Mon Sep 17 00:00:00 2001 From: Paul DeCarlo Date: Mon, 4 Jun 2018 09:50:04 -0500 Subject: [PATCH 3/4] Remove operations in arm image --- Dockerfile.arm32v6 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile.arm32v6 b/Dockerfile.arm32v6 index de80d6ac..b1aae39e 100644 --- a/Dockerfile.arm32v6 +++ b/Dockerfile.arm32v6 @@ -14,9 +14,6 @@ RUN GOARCH=arm go build -o /bin/chaoskube -v \ FROM arm32v6/alpine:3.7 MAINTAINER Linki -RUN apk --no-cache add ca-certificates dumb-init tzdata -RUN addgroup -S chaoskube && adduser -S -g chaoskube chaoskube COPY --from=builder /bin/chaoskube /bin/chaoskube -USER chaoskube -ENTRYPOINT ["dumb-init", "--", "/bin/chaoskube"] +ENTRYPOINT ["/bin/chaoskube"] \ No newline at end of file From 4a981ff584a3df2037bf814527bec06555d953ec Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Sun, 20 Jan 2019 11:24:09 +0100 Subject: [PATCH 4/4] chore: update arm dockerfile to latest version --- Dockerfile.arm32v6 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile.arm32v6 b/Dockerfile.arm32v6 index b1aae39e..03ca07d4 100644 --- a/Dockerfile.arm32v6 +++ b/Dockerfile.arm32v6 @@ -1,19 +1,22 @@ # builder image -FROM golang:1.10-alpine3.7 as builder +FROM golang:1.11-alpine3.8 as builder +ENV CGO_ENABLED 0 RUN apk --no-cache add git RUN go get github.com/golang/dep/cmd/dep WORKDIR /go/src/github.com/linki/chaoskube COPY . . RUN dep ensure -vendor-only RUN go test -v ./... -RUN GOARCH=arm go build -o /bin/chaoskube -v \ +ENV GOARCH arm +RUN go build -o /bin/chaoskube -v \ -ldflags "-X main.version=$(git describe --tags --always --dirty) -w -s" # final image -FROM arm32v6/alpine:3.7 +FROM arm32v6/alpine:3.8 MAINTAINER Linki COPY --from=builder /bin/chaoskube /bin/chaoskube -ENTRYPOINT ["/bin/chaoskube"] \ No newline at end of file +USER 65534 +ENTRYPOINT ["/bin/chaoskube"]