Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi36 committed Nov 20, 2018
1 parent 65b6c7f commit 2621e50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.11.2 as builder
COPY . /go/src/github.com/swisstxt/cloudstack-cloud-controller-manager
WORKDIR /go/src/github.com/swisstxt/cloudstack-cloud-controller-manager
RUN make clean && CGO_ENABLED=0 GOOS=linux make

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/swisstxt/cloudstack-cloud-controller-manager/cloudstack-ccm .
CMD ["./cloudstack-ccm"]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
VERSION=v0.0.1
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
GIT_COMMIT=$(shell git rev-parse HEAD)
GIT_COMMIT_SHORT=$(shell git rev-parse --short HEAD)
GIT_VERSION=${VERSION}-master+${GIT_COMMIT}
LDFLAGS="-X github.com/swisstxt/cloudstack-cloud-controller-manager/vendor/k8s.io/kubernetes/pkg/version.gitVersion=${GIT_VERSION} -X github.com/swisstxt/cloudstack-cloud-controller-manager/vendor/k8s.io/kubernetes/pkg/version.gitCommit=${GIT_COMMIT} -X github.com/swisstxt/cloudstack-cloud-controller-manager/vendor/k8s.io/kubernetes/pkg/version.buildDate=${BUILD_DATE}"

Expand All @@ -16,3 +17,6 @@ clean:

cloudstack-ccm: ${CMD_SRC}
go build -ldflags ${LDFLAGS} -o $@ $^

docker:
docker build . -t cloudstack-cloud-controller-manager:${GIT_COMMIT_SHORT}

0 comments on commit 2621e50

Please sign in to comment.