-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 763 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 763 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
FROM golang:1.21 AS build
ENV CGO_ENABLED=0
ENV GOOS=linux
RUN useradd -u 10001 benthos
WORKDIR /workspace/benthos
# Update dependencies: On unchanged dependencies, cached layer will be reused
COPY go.* /workspace/benthos
RUN go mod download
# Build
COPY . /workspace/benthos
# Tag timetzdata required for busybox base image:
# https://github.com/benthosdev/benthos/issues/897
RUN go build -tags timetzdata -o benthos .
# Pack
FROM busybox AS package
LABEL maintainer="Carlos Martinez <carlosmartcarr@gmail.com>"
WORKDIR /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /workspace/benthos .
USER benthos
EXPOSE 4195
ENTRYPOINT ["/benthos"]