diff --git a/.goreleaser.yml b/.goreleaser.yml index d5f1e312cf..372dc615b4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -72,12 +72,24 @@ scoop: email: hi@ory.sh 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 diff --git a/Dockerfile b/Dockerfile index 6cd4d6eca3..49cc3d78d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile-alpine b/Dockerfile-alpine new file mode 100644 index 0000000000..4b10511d0e --- /dev/null +++ b/Dockerfile-alpine @@ -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"] diff --git a/Makefile b/Makefile index aa1c679251..3f173cbe2a 100644 --- a/Makefile +++ b/Makefile @@ -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