-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f01c2c1
commit 6f87678
Showing
5 changed files
with
20 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
ARG PKTVISOR_TAG=latest-develop | ||
ARG OTEL_TAG=0.111.0 | ||
|
||
FROM golang:1.23-alpine AS builder | ||
|
||
WORKDIR /go/src/github.com/netboxlabs/orb-agent | ||
COPY go.mod . | ||
RUN go mod tidy | ||
COPY . . | ||
RUN apk update && apk add make build-base git | ||
RUN apk update && apk add --no-cache build-base git make | ||
RUN mkdir /tmp/build && CGO_ENABLED=1 make agent_bin && mv build/orb-agent /tmp/build/orb-agent | ||
|
||
FROM otel/opentelemetry-collector-contrib:${OTEL_TAG} AS otelcol-contrib | ||
|
||
FROM orbcommunity/pktvisor:${PKTVISOR_TAG} | ||
|
||
RUN mkdir /opt/orb | ||
RUN addgroup --system netdev && useradd -m --shell /bin/bash -G netdev appuser && echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
# Create necessary directories and set ownership to appuser | ||
RUN mkdir -p /opt/orb && chown appuser:appuser /opt/orb \ | ||
&& chown appuser:appuser /usr/local/bin \ | ||
&& chown appuser:appuser /var/run | ||
|
||
COPY --from=builder /tmp/build/orb-agent /usr/local/bin/orb-agent | ||
COPY --from=builder /go/src/github.com/netboxlabs/orb-agent/agent/docker/agent_default.yaml /opt/orb/agent_default.yaml | ||
COPY --from=builder /go/src/github.com/netboxlabs/orb-agent/agent/docker/orb-agent-entry.sh /usr/local/bin/orb-agent-entry.sh | ||
COPY --from=builder /go/src/github.com/netboxlabs/orb-agent/agent/docker/run-agent.sh /run-agent.sh | ||
|
||
COPY --from=otelcol-contrib /otelcol-contrib /usr/local/bin/otelcol-contrib | ||
|
||
RUN chmod a+x /run-agent.sh | ||
|
||
USER appuser | ||
|
||
ENTRYPOINT [ "/usr/local/bin/orb-agent-entry.sh" ] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters