forked from segmentio/topicctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 714 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 714 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
# build topicctl
FROM --platform=$BUILDPLATFORM golang:1.22 as builder
ENV SRC github.com/getsentry/topicctl
ENV CGO_ENABLED=0
ARG VERSION
RUN test -n "${VERSION}"
COPY . /go/src/${SRC}
ARG TARGETOS TARGETARCH
RUN cd /go/src/${SRC} && \
GOOS=$TARGETOS GOARCH=$TARGETARCH make topicctl VERSION=${VERSION}
# copy topicctl & scripts to python image
FROM python:3.12-slim-bookworm
RUN groupadd -r topicctl --gid 1000 && useradd -r -m -g topicctl --uid 1000 topicctl
COPY --from=builder \
/go/src/github.com/getsentry/topicctl/build/topicctl \
/bin/topicctl
COPY scripts/* /bin/
COPY py/*.py /bin/
COPY py/requirements.txt /
RUN pip install -r requirements.txt
USER topicctl
CMD ["/bin/topicctl"]