-
-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into pr/3143
- Loading branch information
Showing
925 changed files
with
43,207 additions
and
29,565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,43 @@ | ||
# syntax = docker/dockerfile:1-experimental | ||
FROM golang:1.19-alpine3.16 AS base | ||
# Workaround for https://github.com/GoogleContainerTools/distroless/issues/1342 | ||
FROM golang:1.21 AS builder | ||
|
||
RUN apk --update upgrade && apk --no-cache --update-cache --upgrade --latest add ca-certificates build-base gcc | ||
RUN apt-get update && apt-get upgrade -y &&\ | ||
mkdir -p /var/lib/sqlite | ||
|
||
WORKDIR /go/src/github.com/ory/kratos | ||
|
||
ADD go.mod go.mod | ||
ADD go.sum go.sum | ||
ADD internal/httpclient/go.* internal/httpclient/ | ||
ADD internal/client-go/go.* internal/client-go/ | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
COPY internal/httpclient/go.* internal/httpclient/ | ||
COPY internal/client-go/go.* internal/client-go/ | ||
|
||
ENV GO111MODULE on | ||
ENV CGO_ENABLED 1 | ||
ENV CGO_CPPFLAGS -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 | ||
|
||
RUN go mod download | ||
|
||
ADD . . | ||
COPY . . | ||
|
||
ARG VERSION | ||
ARG COMMIT | ||
ARG BUILD_DATE | ||
|
||
RUN --mount=type=cache,target=/root/.cache/go-build go build -tags sqlite \ | ||
-ldflags="-X 'github.com/ory/kratos/driver/config.Version=${VERSION}' -X 'github.com/ory/kratos/driver/config.Date=${BUILD_DATE}' -X 'github.com/ory/kratos/driver/config.Commit=${COMMIT}'" \ | ||
-o /usr/bin/kratos | ||
-ldflags="-X 'github.com/ory/kratos/driver/config.Version=${VERSION}' -X 'github.com/ory/kratos/driver/config.Date=${BUILD_DATE}' -X 'github.com/ory/kratos/driver/config.Commit=${COMMIT}'" \ | ||
-o /usr/bin/kratos | ||
|
||
FROM alpine:3.16 | ||
######################### | ||
FROM gcr.io/distroless/base-nossl-debian12:nonroot AS runner | ||
|
||
RUN addgroup -S ory; \ | ||
adduser -S ory -G ory -D -u 10000 -h /home/ory -s /bin/nologin; \ | ||
chown -R ory:ory /home/ory | ||
COPY --from=builder --chown=nonroot:nonroot /var/lib/sqlite /var/lib/sqlite | ||
COPY --from=builder --chown=nonroot:nonroot /usr/bin/kratos /usr/bin/kratos | ||
|
||
COPY --from=base /usr/bin/kratos /usr/bin/kratos | ||
|
||
# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which | ||
# is required for read/write of SQLite. | ||
RUN mkdir -p /var/lib/sqlite | ||
RUN chown ory:ory /var/lib/sqlite | ||
VOLUME /var/lib/sqlite | ||
|
||
# Exposing the ory home directory to simplify passing in Kratos configuration (e.g. if the file $HOME/.kratos.yaml | ||
# exists, it will be automatically used as the configuration file). | ||
VOLUME /home/ory | ||
|
||
# Declare the standard ports used by Kratos (4433 for public service endpoint, 4434 for admin service endpoint) | ||
EXPOSE 4433 4434 | ||
|
||
USER 10000 | ||
|
||
ENTRYPOINT ["kratos"] | ||
CMD ["serve"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM gcr.io/distroless/static-debian12:nonroot | ||
|
||
COPY kratos /usr/bin/kratos | ||
EXPOSE 4433 4434 | ||
|
||
ENTRYPOINT ["kratos"] | ||
CMD ["serve"] |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
* @aeneasr @zepatrik | ||
* @aeneasr @zepatrik @hperl | ||
|
||
/docs/ @ory/documenters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.