-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
79 lines (59 loc) · 2.29 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM node:23.4-alpine
ENV VERSION=v1.31.0
ENV NODE_ENV=production
ENV SERVICE_ENABLE_SSHD=true
ENV SERVICE_ENABLE_API=true
ENV SERVICE_ENABLE_FIREBASE=false
RUN apk update --no-cache && apk upgrade --no-cache && apk add bash tar
# Install build dependencies
RUN apk add --no-cache \
build-base \
linux-headers \
openssl-dev \
zlib-dev \
file \
wget
# Download the latest OpenSSH (9.8p1) source
RUN wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz \
&& tar -xzf openssh-9.9p1.tar.gz \
&& cd openssh-9.9p1 \
# Configure and compile the source
&& ./configure \
&& make \
&& make install
# Cleanup build dependencies and unnecessary files
RUN apk del build-base linux-headers openssl-dev zlib-dev file wget \
&& rm -rf /openssh-9.9p1.tar.gz /openssh-9.9p1
RUN apk add --no-cache nfs-utils rpcbind curl ca-certificates nano tzdata ncurses make tcpdump \
&& curl -L https://storage.googleapis.com/kubernetes-release/release/$VERSION/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& kubectl version --client \
&& rm -rf /etc/ssh/* \
&& mkdir -p /etc/ssh/authorized_keys.d \
&& cp /usr/share/zoneinfo/America/New_York /etc/localtime \
&& echo "America/New_York" > /etc/timezone \
&& apk del tzdata
RUN curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install-dir=/root --disable-prompts
ENV PATH $PATH:/root/google-cloud-sdk/bin
#RUN gcloud components update kubectl
RUN gcloud components install gke-gcloud-auth-plugin
ENV USE_GKE_GCLOUD_AUTH_PLUGIN True
RUN \
npm -g install pm2
RUN \
mkdir -p /home/node/.kube && \
mkdir -p /opt/sources/rabbitci/rabbit-ssh && \
mkdir -p /root/.ssh
ADD . /opt/sources/rabbitci/rabbit-ssh
COPY static/etc/ssh/ /etc/ssh/
WORKDIR /opt/sources/rabbitci/rabbit-ssh
RUN \
chown node:node /opt/sources/rabbitci/rabbit-ssh/bin/controller.ssh.entrypoint.sh && \
chmod +x /opt/sources/rabbitci/rabbit-ssh/bin/controller.ssh.entrypoint.sh && \
touch /var/log/sshd.log && \
chown node:node /var/log/sshd.log && \
chown -R node:node /home/node
VOLUME [ "/etc/ssh/authorized_keys.d" ]
ENTRYPOINT ["/opt/sources/rabbitci/rabbit-ssh/bin/entrypoint.sh"]
EXPOSE 22
CMD [ "/usr/local/bin/node", "/usr/local/bin/pm2", "logs" ]