-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.alpine
More file actions
37 lines (26 loc) · 898 Bytes
/
Copy pathDockerfile.alpine
File metadata and controls
37 lines (26 loc) · 898 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
33
34
35
36
37
# Build stage
FROM golang:1.23.8-alpine AS builder
# Install build tools
RUN apk add --no-cache build-base
# Set up workspace
WORKDIR /app
# Copy go mod files and download dependencies
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy the rest of the code
COPY . .
# Build statically linked binary
ARG VERSION=unknown
RUN CGO_ENABLED=1 go build -mod=readonly -ldflags "-extldflags='-Wl,-z,lazy' -X 'github.com/coroot/coroot-node-agent/flags.Version=${VERSION}'" -o nudgebee-node-agent .
# Runtime stage
FROM alpine:3.23 AS release-stage
# Install SSL/TLS libraries for HTTPS LLM API tracing
RUN apk add --no-cache openssl libssl3 ca-certificates
WORKDIR /app
# Copy the statically linked binary
COPY --from=builder /app/nudgebee-node-agent /usr/bin/nudgebee-node-agent
# Ensure it's executable
RUN chmod +x /usr/bin/nudgebee-node-agent
# Run it
CMD ["/usr/bin/nudgebee-node-agent"]