-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (27 loc) 路 1.17 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (27 loc) 路 1.17 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
# The AgentKit frontend image (BuildKit gateway).
#
# Referenced as the build syntax of an agentkitfile.yaml:
# #syntax=ghcr.io/sozercan/agentkit/agentkit:latest
# BuildKit pulls this image and runs /bin/agentkit as the gateway frontend, which
# turns a `kind: Agent` file into a standard OCI image of a tool-using agent.
#
# Mirrors AIKit's root Dockerfile: a static, CGO-free build of ./cmd/frontend
# from a golang builder, shipped FROM scratch with just CA certs + the binary.
FROM --platform=$BUILDPLATFORM golang:1.26-bookworm@sha256:5f68ec6805843bd3981a951ffada82a26a0bd2631045c8f7dba483fa868f5ec5 AS builder
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT=""
ARG LDFLAGS
COPY . /go/src/github.com/sozercan/agentkit
WORKDIR /go/src/github.com/sozercan/agentkit
RUN CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
GOARM=${TARGETVARIANT} \
go build -o /agentkit -ldflags "${LDFLAGS} -w -s -extldflags '-static'" ./cmd/frontend
FROM scratch
LABEL org.opencontainers.image.source="https://github.com/sozercan/agentkit"
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
COPY --from=builder /agentkit /bin/agentkit
ENTRYPOINT ["/bin/agentkit"]