Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-arch #17

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
FROM golang:1.11.6-stretch as golang
ARG BUILDPLATFORM=linux/amd64

FROM --platform=$BUILDPLATFORM golang:1.11.6-stretch as golang
WORKDIR /go/src/github.com/buoyantio/bb
ADD . /go/src/github.com/buoyantio/bb

RUN mkdir -p /out
RUN ./bin/dep ensure
RUN go build -o /out/bb .
ARG TARGETARCH
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /out/bb .

FROM debian:buster-20200514-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
dnsutils \
iptables \
jq \
nghttp2 \
ca-certificates && \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of moving the && to the same line as rm -rf, like we had here? For me it's more readable, but take it or leave it

rm -rf /var/lib/apt/lists/*

# We still rely on old iptables-legacy syntax.
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy \
&& update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

FROM gcr.io/linkerd-io/base:2019-02-19.01
RUN apt-get update
RUN apt-get install -y ca-certificates
COPY --from=golang /out /out
ENTRYPOINT ["/out/bb"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,10 @@ You can then use `curl`to query the service:

$ curl `minikube -n bb-readme service bb-readme-gateway-svc --url`
{"requestUid":"in:http-sid:point-to-point-channel-grpc:-1-h1:8080-66349706","payload":"BANANA"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a note and commands here to create the multiarch builder image? Something like what we have here: https://github.com/linkerd/linkerd2-proxy-init/blob/master/Makefile#L73

## Build Multi-Arch Images with Buildx

docker buildx build . \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
--push \
--tag buoyantio/bb:<version>