-
Notifications
You must be signed in to change notification settings - Fork 79
/
Dockerfile.Ubuntu
31 lines (24 loc) · 1001 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
30
31
FROM ubuntu:latest
ENV USER docker
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
# try to set correct terminal-size
RUN echo '[[ -n $TERM_HEIGHT ]] && stty rows $TERM_HEIGHT cols $TERM_WIDTH' >> /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
ENTRYPOINT ["kafkactl"]