Skip to content

Commit

Permalink
Add alpine-based Docker image (#318)
Browse files Browse the repository at this point in the history
Closes #312
  • Loading branch information
aeneasr authored Dec 18, 2019
1 parent 9870722 commit 815951b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,24 @@ scoop:
email: [email protected]

dockers:
- image_templates:
- dockerfile: Dockerfile
binaries:
- oathkeeper
image_templates:
- "oryd/oathkeeper:v{{ .Major }}"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "oryd/oathkeeper:{{ .Env.DOCKER_SHORT_TAG }}"
- "oryd/oathkeeper:latest"
- dockerfile: Dockerfile-alpine
binaries:
- oathkeeper
image_templates:
- "oryd/oathkeeper:v{{ .Major }}-alpine"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}-alpine"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-alpine"
- "oryd/oathkeeper:{{ .Env.DOCKER_SHORT_TAG }}-alpine"
- "oryd/oathkeeper:latest-alpine"

release:
prerelease: auto
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# To compile this image manually run:
#
# $ GO111MODULE=on GOOS=linux GOARCH=amd64 go build && docker build -t oryd/oathkeeper . && rm oathkeeper
FROM alpine:3.9
# $ make docker
FROM alpine:3.10

RUN apk add -U --no-cache ca-certificates

Expand Down
15 changes: 15 additions & 0 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To compile this image manually run:
#
# $ make docker
FROM alpine:3.10

RUN addgroup -S ory; \
adduser -S ory -G ory -D -H -s /bin/nologin
RUN apk add -U --no-cache ca-certificates

COPY oathkeeper /usr/bin/oathkeeper

USER ory

ENTRYPOINT ["oathkeeper"]
CMD ["serve"]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ docker:
packr2 || (GO111MODULE=on go install github.com/gobuffalo/packr/v2/packr2 && packr2)
CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build
packr2 clean
docker build -t oryd/oathkeeper:unstable.$$(date +'%s') .
docker build -t oryd/oathkeeper:dev .
docker build -t oryd/oathkeeper:dev-alpine -f Dockerfile-alpine .
rm oathkeeper

0 comments on commit 815951b

Please sign in to comment.