Skip to content

Commit

Permalink
Merge pull request #11 from Krast76/add-dockerfile
Browse files Browse the repository at this point in the history
Add a Dockerfile
  • Loading branch information
jrhouston authored Mar 5, 2021
2 parents 1428768 + c7cb82d commit 7bdc9ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.16-alpine as build
WORKDIR /build
COPY go.* .
RUN go mod download
COPY . .
RUN apk --no-cache add make
RUN CGO_ENABLED=0 make build

FROM scratch
COPY --from=build /build/tfk8s /bin/tfk8s
ENTRYPOINT ["/bin/tfk8s"]
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
.PHONY: build release install test clean
.PHONY: build docker docker-push release install test clean

VERSION := 0.1.1
DOCKER_IMAGE_NAME := jrhouston/tfk8s

build:
go build -ldflags "-X main.toolVersion=${VERSION}"

docker:
docker build -t ${DOCKER_IMAGE_NAME}:${VERSION} .

docker-push: docker
docker push ${DOCKER_IMAGE_NAME}:${VERSION}

release: clean
mkdir -p release/
# FIXME use gox for this
Expand Down

0 comments on commit 7bdc9ec

Please sign in to comment.