Browse Source

Merge branch 'develop' into dependabot/github_actions/actions/cache-4

Matt Ray 2 years ago
parent
commit
5b5fb2f875
5 changed files with 36 additions and 5 deletions
  1. 14 4
      Dockerfile
  2. 7 0
      Dockerfile.cross
  3. 1 1
      Makefile
  4. 7 0
      ui/Dockerfile
  5. 7 0
      ui/Dockerfile.cross

+ 14 - 4
Dockerfile

@@ -14,10 +14,12 @@ ARG CGO_ENABLED=0
 ARG version=dev
 ARG	commit=HEAD
 
-# Get dependencies - will also be cached if we won't change mod/sum
-RUN go mod download
 # COPY the source code as the last step
 COPY . .
+
+# Get dependencies - will also be cached if we won't change mod/sum
+RUN go mod download
+
 # Build the binary
 RUN set -e ;\
     go test ./test/*.go;\
@@ -26,11 +28,19 @@ RUN set -e ;\
     GOOS=linux \
     go build -a -installsuffix cgo \
     -ldflags \
-    "-X github.com/opencost/opencost/pkg/version.Version=${version} \
-    -X github.com/opencost/opencost/pkg/version.GitCommit=${commit}" \
+    "-X github.com/opencost/opencost/core/pkg/version.Version=${version} \
+    -X github.com/opencost/opencost/core/pkg/version.GitCommit=${commit}" \
     -o /go/bin/app
 
 FROM alpine:latest
+
+LABEL org.opencontainers.image.description="Cross-cloud cost allocation models for Kubernetes workloads"
+LABEL org.opencontainers.image.documentation=https://opencost.io/docs/
+LABEL org.opencontainers.image.licenses=Apache-2.0
+LABEL org.opencontainers.image.source=https://github.com/opencost/opencost
+LABEL org.opencontainers.image.title=kubecost-cost-model
+LABEL org.opencontainers.image.url=https://github.com/opencost/opencost
+
 RUN apk add --update --no-cache ca-certificates
 COPY --from=build-env /go/bin/app /go/bin/app
 ADD --chmod=644 ./configs/default.json /models/default.json

+ 7 - 0
Dockerfile.cross

@@ -1,5 +1,12 @@
 FROM alpine:latest
 
+LABEL org.opencontainers.image.description="Cross-cloud cost allocation models for Kubernetes workloads"
+LABEL org.opencontainers.image.documentation=https://opencost.io/docs/
+LABEL org.opencontainers.image.licenses=Apache-2.0
+LABEL org.opencontainers.image.source=https://github.com/opencost/opencost
+LABEL org.opencontainers.image.title=kubecost-cost-model
+LABEL org.opencontainers.image.url=https://github.com/opencost/opencost
+
 # The prebuilt binary path. This Dockerfile assumes the binary will be built
 # outside of Docker.
 ARG binarypath

+ 1 - 1
Makefile

@@ -6,7 +6,7 @@ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
 GIT_LAST_COMMIT_DATE := $(shell git log -1 --date=iso-strict --format=%cd)
 
 # Build flags
-VPREFIX := github.com/opencost/opencost/pkg/version
+VPREFIX := github.com/opencost/opencost/core/pkg/version
 GO_LDFLAGS   := -X $(VPREFIX).Version=$(IMAGE_TAG) -X $(VPREFIX).GitCommit=$(GIT_REVISION)
 GO_FLAGS     := -ldflags "-extldflags \"-static\" -s -w $(GO_LDFLAGS)"
 

+ 7 - 0
ui/Dockerfile

@@ -7,6 +7,13 @@ RUN npx parcel build src/index.html
 
 FROM nginx:alpine
 
+LABEL org.opencontainers.image.description="Cross-cloud cost allocation models for Kubernetes workloads"
+LABEL org.opencontainers.image.documentation=https://opencost.io/docs/
+LABEL org.opencontainers.image.licenses=Apache-2.0
+LABEL org.opencontainers.image.source=https://github.com/opencost/opencost
+LABEL org.opencontainers.image.title=opencost-ui
+LABEL org.opencontainers.image.url=https://github.com/opencost/opencost
+
 ARG version=dev
 ARG	commit=HEAD
 ENV VERSION=${version}

+ 7 - 0
ui/Dockerfile.cross

@@ -1,5 +1,12 @@
 FROM nginx:alpine
 
+LABEL org.opencontainers.image.description="Cross-cloud cost allocation models for Kubernetes workloads"
+LABEL org.opencontainers.image.documentation=https://opencost.io/docs/
+LABEL org.opencontainers.image.licenses=Apache-2.0
+LABEL org.opencontainers.image.source=https://github.com/opencost/opencost
+LABEL org.opencontainers.image.title=opencost-ui
+LABEL org.opencontainers.image.url=https://github.com/opencost/opencost
+
 ARG version=dev
 ARG	commit=HEAD
 ENV VERSION=${version}