-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (35 loc) · 1.7 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (35 loc) · 1.7 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# syntax=docker/dockerfile:1.7
# =============================================================================
# go — LLM honeypot persona
# =============================================================================
# Multi-stage build:
# - build stage compiles all three binaries (runtime, sshfrontend, client)
# - runtime stage picks the one named by ARG BINARY at compose build time
# -----------------------------------------------------------------------------
FROM golang:1.25-alpine AS build
ARG ARCP_SDK_VERSION=latest
ARG BINARY=runtime
ENV CGO_ENABLED=0 \
GOFLAGS=-mod=mod
WORKDIR /src
RUN apk add --no-cache git ca-certificates
COPY go.mod go.sum* ./
# Replace the local-path replace directive with a `go get` of the published
# SDK at the requested version. Falls back gracefully if go.sum is absent.
RUN sed -i '/^replace github.com\/agentruntimecontrolprotocol\/go-sdk/d' go.mod && \
go get "github.com/agentruntimecontrolprotocol/go-sdk@${ARCP_SDK_VERSION}" && \
go mod tidy
COPY src/ ./src/
RUN go build -trimpath -ldflags="-s -w" -o /out/runtime ./src/runtime && \
go build -trimpath -ldflags="-s -w" -o /out/sshfrontend ./src/sshfrontend && \
go build -trimpath -ldflags="-s -w" -o /out/client ./src/client
# -----------------------------------------------------------------------------
FROM alpine:3.20 AS runtime
ARG BINARY=runtime
ENV BINARY=${BINARY}
RUN apk add --no-cache tini ca-certificates wget
COPY --from=build /out/runtime /usr/local/bin/runtime
COPY --from=build /out/sshfrontend /usr/local/bin/sshfrontend
COPY --from=build /out/client /usr/local/bin/client
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/bin/sh", "-c", "exec /usr/local/bin/${BINARY}"]