diff --git a/Dockerfile b/Dockerfile index d9fafd7..a54074c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"]