Преглед изворни кода

Merge pull request #533 from kubecost/bolt/build-improvement

Build Improvements
Matt Bolt пре 5 година
родитељ
комит
ef8a9fc014
2 измењених фајлова са 2 додато и 9 уклоњено
  1. 1 0
      .dockerignore
  2. 1 9
      Dockerfile

+ 1 - 0
.dockerignore

@@ -0,0 +1 @@
+.git

+ 1 - 9
Dockerfile

@@ -11,17 +11,9 @@ RUN go mod download
 COPY . .
 COPY . .
 # Build the binary
 # Build the binary
 RUN set -e ;\
 RUN set -e ;\
-    GIT_COMMIT=`git rev-parse HEAD` ;\
-    GIT_DIRTY='' ;\
-    # for our purposes, we only care about dirty .go files ;\
-    if test -n "`git status --porcelain --untracked-files=no | grep '\.go'`"; then \
-      GIT_DIRTY='+dirty' ;\
-    fi ;\
     cd cmd/costmodel;\
     cd cmd/costmodel;\
     CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
     CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
-    go build -a -installsuffix cgo \
-        -ldflags "-X main.gitCommit=${GIT_COMMIT}${GIT_DIRTY}" \
-        -o /go/bin/app
+    go build -a -installsuffix cgo -o /go/bin/app
 
 
 FROM alpine:3.10.2
 FROM alpine:3.10.2
 RUN apk add --update --no-cache ca-certificates
 RUN apk add --update --no-cache ca-certificates