You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM --platform=$BUILDPLATFORM golang:1.24-alpine@sha256:9fadeb603e14f1f3e08bdbec6681fa14446053c498a554f3e57260bf892c487e AS build
2
+
3
+
ARG TARGETOS TARGETARCH
4
+
ARG KRATOS_VERSION
5
+
6
+
ARG GOOS=$TARGETOS
7
+
ARG GOARCH=$TARGETARCH
8
+
9
+
WORKDIR /src
10
+
11
+
RUN apk update
12
+
RUN apk add git
13
+
14
+
RUN git clone --depth 1 https://github.com/ory/kratos.git
15
+
WORKDIR /src/kratos
16
+
RUN git fetch --tags && git checkout $KRATOS_VERSION
17
+
18
+
# The hydra and kratos migrations attempt to create the same table.
19
+
# Kratos's migration only creates the table while hydra's migration creates the table
20
+
# and inserts a row. Therefore, we replace kratos's problematic version with empty placeholders
21
+
# to avoid a conflict. Removing the problematic migration file prior to module initialization and
22
+
# compilation did not work.
23
+
RUN for file in persistence/sql/migrations/sql/20150100000001000000_networks.*.sql; do echo "-- Migration disabled to avoid conflict with hydra" > "$file"; done
24
+
25
+
ENV GO111MODULE=on
26
+
# kratos and hydra require CGO if sqlite is used, but we exclusively use postgres
27
+
ENV CGO_ENABLED=0
28
+
29
+
RUN go mod download
30
+
31
+
# TODO(ddelnano): Remove once kratos upstream has updated dependencies
0 commit comments