build: Makefile with cross-builds (linux/termux arm64, armv7), non-root distroless Dockerfile, example config
This commit is contained in:
parent
24e4bbe3d1
commit
8896bdc963
4 changed files with 103 additions and 0 deletions
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
# Pinned Go version, matches go.mod (go 1.25).
|
||||
FROM golang:1.25.3-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
ARG VERSION=docker
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o /out/openclaw ./cmd/openclaw \
|
||||
&& mkdir -p /out/data
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
COPY --from=build /out/openclaw /usr/local/bin/openclaw
|
||||
COPY --from=build --chown=65532:65532 /out/data /data
|
||||
ENV OPENCLAW_DATA_DIR=/data \
|
||||
OPENCLAW_LISTEN=0.0.0.0:8787
|
||||
USER 65532:65532
|
||||
EXPOSE 8787
|
||||
VOLUME ["/data"]
|
||||
ENTRYPOINT ["/usr/local/bin/openclaw"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue