Skip to content

Commit

Permalink
Add Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofranssen committed Aug 26, 2021
1 parent 56afb75 commit c41957c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.17-alpine as builder
RUN mkdir build
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN apk add --no-cache make git
RUN make build

FROM busybox
LABEL maintainer="marco.franssen@philips.com"
RUN mkdir -p /app
WORKDIR /app
ENV VAULT_ADDR=
COPY --from=builder build/bin/spiffe-vault .
ENTRYPOINT [ "/app/spiffe-vault" ]
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ help:
FORCE: ;

bin/%: cmd/% FORCE
go build $(GO_BUILD_FLAGS) -o $@ ./$<
CGO_ENABLED=0 go build $(GO_BUILD_FLAGS) -o $@ ./$<

.PHONY: download
download: ## download dependencies via go mod
go mod download

.PHONY: build
build: $(addprefix bin/,$(COMMANDS)) ## builds binaries

.PHONY: image
image: ## build the binary in a docker image
docker build \
-t "philipssoftware/spiffe-vault:$(GIT_TAG)" \
-t "philipssoftware/spiffe-vault:$(GIT_HASH)" .

0 comments on commit c41957c

Please sign in to comment.