mirror of
https://gitlab.com/arm-research/smarter/smarter-device-manager.git
synced 2024-11-23 11:12:11 +00:00
Compile device-manager statically and use scratch base image
Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
This commit is contained in:
parent
d65b7208db
commit
07f4b88b53
@ -10,15 +10,13 @@ COPY . .
|
||||
|
||||
RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
|
||||
go mod init arm.com/smarter-device-management && go mod tidy && go mod vendor && \
|
||||
go build -ldflags="-s -w" .
|
||||
CGO_ENABLED=0 go build -ldflags='-s -w -extldflags="-static"' .
|
||||
|
||||
FROM alpine
|
||||
|
||||
RUN apk update && apk upgrade
|
||||
FROM scratch
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
COPY conf.yaml /root/config/conf.yaml
|
||||
COPY --from=build /arm.com/smarter-device-management/smarter-device-management /usr/bin/smarter-device-management
|
||||
|
||||
CMD ["smarter-device-management","-logtostderr=true","-v=0"]
|
||||
CMD ["/usr/bin/smarter-device-management","-logtostderr=true","-v=0"]
|
||||
|
Loading…
Reference in New Issue
Block a user