-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (29 loc) · 971 Bytes
/
Dockerfile
File metadata and controls
32 lines (29 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# syntax=docker/dockerfile:1.7
ARG GO_VERSION=1.26
ARG ALPINE_VERSION=3.23
FROM golang:${GO_VERSION}-alpine AS build
RUN apk add --no-cache ca-certificates git
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath \
-ldflags="-s -w -X github.com/openclaw/discrawl/internal/cli.version=${VERSION}" \
-o /out/discrawl ./cmd/discrawl
FROM alpine:${ALPINE_VERSION}
RUN apk add --no-cache ca-certificates git openssh-client tzdata \
&& adduser -D -u 10001 -h /home/discrawl discrawl \
&& mkdir -p /data/config /data/data /data/cache /data/state \
&& chown -R discrawl:discrawl /data
ENV HOME=/home/discrawl \
XDG_CONFIG_HOME=/data/config \
XDG_DATA_HOME=/data/data \
XDG_CACHE_HOME=/data/cache \
XDG_STATE_HOME=/data/state
VOLUME ["/data"]
WORKDIR /data
COPY --from=build /out/discrawl /usr/local/bin/discrawl
USER discrawl
ENTRYPOINT ["discrawl"]
CMD ["--help"]