Skip to content

Commit

Permalink
updates dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gradientsearch committed Jun 13, 2023
1 parent f175260 commit 26e7dea
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
FROM registry.fedoraproject.org/fedora-minimal:38 AS builder

RUN microdnf install -y systemd-devel golang git && microdnf clean all
FROM golang:1.20 as builder

WORKDIR /go/src/audito-maldito

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
COPY cmd ./cmd
COPY ingesters ./ingesters
COPY internal ./internal
COPY processors ./processors
COPY main.go .

RUN go build -o audito-maldito

# Not using distroless nor scratch because we need the systemd shared libraries
FROM registry.fedoraproject.org/fedora-minimal:38

FROM alpine:3.17.3
# NOTE(jaosorior): Yes, we need to be the root user for this case.
# We need access to the journal's privileged log entries and the audit log in the future.
USER 0

COPY --from=builder /go/src/audito-maldito/audito-maldito /usr/bin/audito-maldito

ENTRYPOINT [ "/usr/bin/audito-maldito" ]
ENTRYPOINT [ "/usr/bin/audito-maldito" ]

0 comments on commit 26e7dea

Please sign in to comment.