Some checks failed
CI / Run tests and lints (push) Failing after 29s
CI / Build CLI docs (push) Has been skipped
CI / Run Playwright end-to-end tests (mysql) (push) Failing after 3s
CI / Run Playwright end-to-end tests (postgres) (push) Failing after 2s
CI / Run Playwright end-to-end tests (sqlite) (push) Failing after 3s
CodeQL / Analyze (go) (push) Failing after 4s
CodeQL / Analyze (javascript) (push) Failing after 3s
Docker Image Scanners / scanners (push) Failing after 4s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Run end-to-end tests (postgres) (push) Failing after 19s
CI / Run end-to-end tests (sqlite) (push) Failing after 2s
CI / Run Playwright end-to-end tests (cockroach) (push) Failing after 2s
CI / Draft newsletter (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped
47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
FROM golang:1.26-trixie AS builder
|
|
|
|
RUN apt-get update && apt-get upgrade -y &&\
|
|
mkdir -p /var/lib/sqlite
|
|
|
|
WORKDIR /go/src/github.com/ory/kratos
|
|
|
|
COPY oryx/go.mod oryx/go.mod
|
|
COPY oryx/go.sum oryx/go.sum
|
|
|
|
|
|
COPY go.mod go.mod
|
|
COPY go.sum go.sum
|
|
COPY pkg/client-go/go.* pkg/client-go/
|
|
|
|
ENV CGO_ENABLED 0
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
ARG VERSION
|
|
ARG COMMIT
|
|
ARG BUILD_DATE
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/go-build go build \
|
|
-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
|
|
|
|
#########################
|
|
# Kratos is built with CGO_ENABLED=0, so it needs no glibc at runtime. The static
|
|
# base carries none, which keeps this image free of the unfixable libc6
|
|
# advisories the base-nossl variant ships with, and matches the base the released
|
|
# images use (.docker/Dockerfile-distroless-static).
|
|
FROM gcr.io/distroless/static-debian12:nonroot AS runner
|
|
|
|
COPY --from=builder --chown=nonroot:nonroot /var/lib/sqlite /var/lib/sqlite
|
|
COPY --from=builder --chown=nonroot:nonroot /usr/bin/kratos /usr/bin/kratos
|
|
|
|
VOLUME /var/lib/sqlite
|
|
|
|
# Declare the standard ports used by Kratos (4433 for public service endpoint, 4434 for admin service endpoint)
|
|
EXPOSE 4433 4434
|
|
|
|
ENTRYPOINT ["kratos"]
|
|
CMD ["serve"]
|