forked from deviceinsight/kafkactl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.Ubuntu
29 lines (23 loc) · 883 Bytes
/
Dockerfile.Ubuntu
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
FROM ubuntu:latest
ENV USER docker
ENV BROKERS localhost:9092
COPY kafkactl /usr/local/bin
RUN apt-get update && apt-get install -y bash-completion
# install bash completion script
RUN mkdir /etc/bash_completion.d
RUN kafkactl completion bash > /etc/bash_completion.d/kafkactl
# Create an app user so our program doesn't run as root.
RUN mkdir -p /home/kafkactl
RUN groupadd -r kafkactl
RUN useradd -r -g kafkactl -d /home/kafkactl -s /sbin/nologin -c "Docker image user" kafkactl
# make sure completion is loaded
RUN echo "source /etc/bash_completion" > /home/kafkactl/.bashrc
RUN echo "source /etc/bash_completion.d/kafkactl " >> /home/kafkactl/.bashrc
# Install CA certificates
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /home/kafkactl
RUN chown -R kafkactl:kafkactl /home/kafkactl
USER kafkactl
CMD ["kafkactl"]