-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (37 loc) · 1.83 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
FROM gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.11.0 AS cloudsql
FROM docker.io/library/golang:1 AS http-server
WORKDIR /app
COPY go-httpserver .
RUN go build .
FROM docker.io/library/ubuntu:latest
ENV KAFKA_VERSION=3.8.0
RUN ln -snf /usr/share/zoneinfo/US/Pacific /etc/localtime && \
apt update && \
apt install -y zsh mariadb-client postgresql-client dnsutils netcat-traditional jq \
neovim curl gnupg openjdk-21-jre-headless tcpdump rclone sysstat socat conntrack \
sudo sshpass iproute2 unzip && \
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list && \
apt update && \
apt install -y kubectl && \
curl -LO https://apache.osuosl.org/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz && \
tar xzvf kafka_2.13-$KAFKA_VERSION.tgz && \
mv kafka_2.13-$KAFKA_VERSION /opt/kafka && \
rm -rf kafka_2.13-$KAFKA_VERSION.tgz && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/lib/dpkg/info/* && \
echo "set editing-mode vi" | tee -a /etc/inputrc && \
echo "set keymap vi" | tee -a /etc/inputrc && \
echo "ubuntu ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/ubuntu-root && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
sudo ./aws/install && \
rm -rf awscliv2.zip aws
COPY tools/check-clock-skew.sh /usr/local/bin/check-clock-skew.sh
COPY --from=cloudsql /cloud-sql-proxy /usr/local/bin/cloud-sql-proxy
COPY --from=http-server /app/go-httpserver /usr/local/bin/go-httpserver
COPY --chown=5000:5000 zshrc /home/ubuntu/.zshrc
WORKDIR /home/ubuntu
ENV SHELL=/usr/bin/zsh
USER 1000:1000
ENTRYPOINT ["/usr/bin/zsh"]