-
Notifications
You must be signed in to change notification settings - Fork 221
/
Copy pathDockerfile
21 lines (14 loc) · 934 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
##### build stage ###########################################################
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM golang:1.9.2-alpine as golang
ADD . /go/src/github.com/linkerd/linkerd-examples/docker/helloworld/
ARG TARGETARCH
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /go/bin/helloworld /go/src/github.com/linkerd/linkerd-examples/docker/helloworld/main.go
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /go/bin/helloworld-client /go/src/github.com/linkerd/linkerd-examples/docker/helloworld/helloworld-client/main.go
##### run stage #############################################################
FROM alpine:3.6
RUN apk add --update curl jq && rm -rf /var/cache/apk/*
COPY ./hostIP.sh /usr/local/bin
COPY --from=golang /go/bin/helloworld /usr/local/bin/helloworld
COPY --from=golang /go/bin/helloworld-client /usr/local/bin/helloworld-client
ENTRYPOINT ["/usr/local/bin/helloworld"]