-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_testing
49 lines (38 loc) · 1.71 KB
/
Dockerfile_testing
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
43
44
45
46
47
48
49
FROM ubuntu:22.04
USER root
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get -y install \
openssh-server \
rsync \
vim \
net-tools \
iproute2 \
ca-certificates \
curl
# unminimize the ubuntu image
RUN sed -i 's/^read.*//g' /usr/local/sbin/unminimize && \
sed -i 's/exit 1/echo "skip"/g' /usr/local/sbin/unminimize && \
sed -i 's/apt-get upgrade/apt-get upgrade -y/g' /usr/local/sbin/unminimize && \
/usr/local/sbin/unminimize
# Copy ssh keys
RUN mkdir -p /root/.ssh && \
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFFaL0dy3Dq4DA5GCqFBKVWZntBSF0RIeVd9/qdhIj2n" > /root/.ssh/authorized_keys && \
chmod go-rwx /root/.ssh && \
printf "ed25519\t%s\nrsa\t%s" $(ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub | sed -E 's|.*SHA256:(.*) root.*|\1|') \
$(ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub | sed -E 's|.*SHA256:(.*) root.*|\1|') >/tmp/hostkeys && \
service ssh start
# Install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" && \
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
rm kubectl kubectl.sha256
# Set up go debug environment
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y golang && \
echo 'export PATH="$PATH:/root/go/bin"' >> /root/.bashrc && \
go install github.com/go-delve/delve/cmd/dlv@latest
RUN mkdir /tmp/podcaches
ADD "." "/root/user_pods_backend/"
WORKDIR "/root/user_pods_backend"
RUN go build main.go
CMD ["/usr/sbin/sshd", "-D"]