diff --git a/Dockerfile.kratos b/Dockerfile.kratos index 1fed03ea..a26cb2c6 100644 --- a/Dockerfile.kratos +++ b/Dockerfile.kratos @@ -4,14 +4,17 @@ # https://securityonion.net/license; you may not use this file except in compliance with the # Elastic License 2.0. -FROM ghcr.io/security-onion-solutions/golang:alpine AS builder +FROM ghcr.io/security-onion-solutions/golang:1.21 AS builder ARG OWNER=ory -ARG VERSION=v1.0.0 +ARG VERSION=v1.1.0 + +RUN addgroup --system ory; \ + adduser --system ory --no-create-home --disabled-password --ingroup ory --disabled-login + +RUN apt-get update && apt-get upgrade -y && apt-get install -y git gcc bash +RUN mkdir -p /var/lib/sqlite -RUN addgroup -S ory; \ - adduser -S ory -G ory -D -H -s /bin/nologin -RUN apk -U --no-cache add build-base git gcc bash RUN mkdir -p /go/src/github.com/$OWNER WORKDIR /go/src/github.com/$OWNER @@ -23,9 +26,11 @@ RUN git checkout $VERSION ENV GO111MODULE on ENV CGO_ENABLED 1 +ENV CGO_CPPFLAGS -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 RUN go mod download -RUN go build -tags sqlite -a +RUN go build -tags sqlite -ldflags="-X 'github.com/ory/kratos/driver/config.Version=${VERSION}' -X 'github.com/ory/kratos/driver/config.Date=$(date -I)' -X 'github.com/ory/kratos/driver/config.Commit=$(git rev-parse --short HEAD)'" + FROM ghcr.io/security-onion-solutions/alpine:latest