Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Improve Dockerfile for 4g example
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Morales <[email protected]>
  • Loading branch information
electrocucaracha committed Dec 8, 2020
1 parent a76792f commit 22ce765
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions examples/4g-network/sidecar-nse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM golang:alpine as build
RUN apk --no-cache add git
FROM golang:1.15.1-alpine3.12 as build

ENV PACKAGEPATH=github.com/networkservicemesh/networkservicemesh/
ENV GO111MODULE=on

RUN mkdir /root/networkservicemesh
ADD ["go.mod","/root/networkservicemesh"]
WORKDIR /root/networkservicemesh/

RUN apk --no-cache add git=2.26.2-r0
COPY go.mod .
RUN go mod download

ADD [".","/root/networkservicemesh"]
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-extldflags "-static"' -o /go/bin/sidecar-nse ./examples/4g-network/sidecar-nse/cmd/main.go
FROM alpine as runtime
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-extldflags "-static"' -o /go/bin/sidecar-nse ./examples/4g-network/sidecar-nse/cmd/...

FROM alpine:3.12 as runtime
COPY --from=build /go/bin/sidecar-nse /bin/sidecar-nse
ENTRYPOINT ["/bin/sidecar-nse"]

0 comments on commit 22ce765

Please sign in to comment.