-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (22 loc) · 1.04 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
FROM debian:bullseye AS builder
# Using Debian instead of the official Golang image because it’s based on newer OS versions
# with newer glibc, which causes compatibility issues.
RUN apt-get update && apt-get install -y \
curl git build-essential pkg-config libsystemd-dev
ARG GO_VERSION=1.25.0
RUN curl -fsSL https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
WORKDIR /tmp/src
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
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 .
FROM registry.access.redhat.com/ubi9/ubi-minimal AS runtime
ARG VERSION=unknown
# Install SSL/TLS libraries for HTTPS LLM API tracing
RUN microdnf install -y openssl-libs
COPY --from=builder /tmp/src/nudgebee-node-agent /usr/bin/nudgebee-node-agent
ENTRYPOINT ["/usr/bin/nudgebee-node-agent"]