2019-11-22 16:52:49 +00:00
|
|
|
FROM golang:alpine as build
|
|
|
|
|
|
|
|
RUN apk update && apk upgrade && apk add tar ca-certificates build-base
|
|
|
|
|
|
|
|
ENV GOPATH /go
|
|
|
|
RUN go version
|
|
|
|
|
2021-02-23 20:11:15 +00:00
|
|
|
WORKDIR /arm.com/smarter-device-management
|
2019-11-22 16:52:49 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
|
2021-02-23 20:11:15 +00:00
|
|
|
go mod init arm.com/smarter-device-management && go mod tidy && go mod vendor && \
|
2022-09-11 14:39:34 +00:00
|
|
|
CGO_ENABLED=0 go build -ldflags='-s -w -extldflags="-static"' .
|
2019-11-22 16:52:49 +00:00
|
|
|
|
2022-09-11 14:39:34 +00:00
|
|
|
FROM scratch
|
2019-11-22 16:52:49 +00:00
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
|
|
|
COPY conf.yaml /root/config/conf.yaml
|
2021-02-23 20:11:15 +00:00
|
|
|
COPY --from=build /arm.com/smarter-device-management/smarter-device-management /usr/bin/smarter-device-management
|
2019-11-22 16:52:49 +00:00
|
|
|
|
2022-09-11 14:39:34 +00:00
|
|
|
CMD ["/usr/bin/smarter-device-management","-logtostderr=true","-v=0"]
|