-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile.dev-root
More file actions
138 lines (104 loc) · 4.72 KB
/
Copy pathDockerfile.dev-root
File metadata and controls
138 lines (104 loc) · 4.72 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# syntax=docker/dockerfile:1.4
#
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ghcr.io/gchux/cloud-run-ssh:ubuntu-latest-v1.2.0
ARG DEBIAN_FRONTEND=noninteractive
ARG CONTENT_FLAVOR=dev
ARG APP_PORT="8080"
ARG DEV_PORT="8088"
ARG WEB_PORT="8022"
ARG SSH_USER="root"
ARG SSH_PASS="pass"
ARG PASSWORD_ACCESS="true"
ARG SUDO_ACCESS="true"
ARG CLOUDSDK_VERSION=516.0.0
ARG GCSFUSE_VERSION=2.7.0
ARG GOST_VERSION=3.0.0
ARG YQ_VERSION=4.45.1
ARG DOCKER_VERSION=28.0.1
ARG GCREDS_HELPER_VERSION=2.1.25
ARG VSCODE_VERSION=4.98.0
LABEL "DOCKER_VERSION"="${DOCKER_VERSION}"
LABEL "VSCODE_VERSION"="${VSCODE_VERSION}"
ENV SSH_CONTENT_FLAVOR=${CONTENT_FLAVOR}
ENV SSH_USER_NAME=${SSH_USER}
ENV USER_PASSWORD=${SSH_PASS}
ENV WEBAPP_PORT=${APP_PORT}
ENV WEBDEV_PORT=${DEV_PORT}
ENV WEBSSH_PORT=${WEB_PORT}
ENV PASSWORD_ACCESS=${PASSWORD_ACCESS}
ENV SUDO_ACCESS=${SUDO_ACCESS}
ENV LOG_STDOUT=true
ENV SSH_PORT=2222
ENV PUID=0
ENV PGID=0
USER 0:0
WORKDIR /
COPY ./webssh /webssh
COPY ./init/svc ./init/nginx ./init/wssh ./init/dockerd ./init/vscode /bin/init/
COPY ./conf/dev.conf /svc.conf
COPY ./nginx/dev.conf /nginx.conf.template
COPY ./.vscode /.vscode
COPY ./keys/*.pub /pubkeys/
COPY ./cloud_run_ssh_banner ./keys/authorized_keys* /
COPY ./ssh_proxy_client.yaml /ssh_proxy_client.yaml
COPY ./poll_ssh_proxy_server /poll_ssh_proxy_server
COPY ./scripts/gcurl /usr/local/bin/gcurl
COPY ./scripts/gidcurl /usr/local/bin/gidcurl
COPY ./catalogs/commands.json /webssh/webssh/static/json/commands.json
RUN apt-get -qq update > /dev/null \
&& apt-get -qq -yy install --no-install-recommends \
bash gettext dpkg vim net-tools iputils-ping dnsutils iproute2 iptables nginx \
openssl curl wget tmux git bc traceroute tcptraceroute tcpdump jq telnet \
mtr nmap redis python3 python3-pip strace fuse3 fuse-overlayfs > /dev/null \
&& apt-get -qq clean > /dev/null
RUN wget -nv -q -P /usr/bin 'http://www.vdberg.org/~richard/tcpping' \
&& chmod a+rx /usr/bin/tcpping
RUN python3 -m pip config --user set global.progress_bar off \
&& python3 -m pip install --break-system-packages --no-cache-dir --quiet supervisor httpie /webssh
RUN curl -o /gcsfuse.deb -L \
https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v${GCSFUSE_VERSION}/gcsfuse_${GCSFUSE_VERSION}_amd64.deb \
&& dpkg -i --force-all /gcsfuse.deb && rm -vf /gcsfuse.deb
RUN curl -sL -o yq \
https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 \
&& chmod +x /yq && ln -s /yq /usr/local/bin/yq
RUN curl -sL -o gost.tar.gz \
https://github.com/go-gost/gost/releases/download/v${GOST_VERSION}/gost_${GOST_VERSION}_linux_amd64.tar.gz \
&& tar -xzf gost.tar.gz && chmod +x gost && rm -vf gost.tar.gz
RUN echo "root:${USER_PASSWORD}" | chpasswd
RUN curl -sL -o docker.tgz \
https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& tar -xzf docker.tgz && cp -vf docker/* /usr/bin/ && rm -rvf docker && rm -vf docker.tgz
RUN curl -fsSL \
https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v${GCREDS_HELPER_VERSION}/docker-credential-gcr_linux_amd64-${GCREDS_HELPER_VERSION}.tar.gz \
| tar xz docker-credential-gcr && chmod +x docker-credential-gcr && mv docker-credential-gcr /usr/bin/
RUN wget -nv -q -P / \
https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${CLOUDSDK_VERSION}-linux-x86_64.tar.gz \
&& tar -xzf /google-cloud-cli-${CLOUDSDK_VERSION}-linux-x86_64.tar.gz -C / \
&& rm -vf /google-cloud-cli-${CLOUDSDK_VERSION}-linux-x86_64.tar.gz \
&& /google-cloud-sdk/bin/gcloud components install alpha beta --quiet \
&& ln -s /google-cloud-sdk/bin/* /usr/bin/ \
&& echo 'export PATH=${PATH}:/google-cloud-sdk/bin' >> ~/.bashrc
WORKDIR /vscode
RUN curl -sL -o vscode.tar.gz \
https://github.com/coder/code-server/releases/download/v${VSCODE_VERSION}/code-server-${VSCODE_VERSION}-linux-amd64.tar.gz \
&& tar -xzf vscode.tar.gz --strip-components=1 && rm -vf vscode.tar.gz
WORKDIR /
RUN echo "${WEBSSH_PORT}" > /webssh.port \
&& echo "${WEBAPP_PORT}" > /webapp.port \
&& echo "${WEBDEV_PORT}" > /webdev.port \
&& chsh -s /bin/bash root \
&& mkdir -pv /dl/
CMD ["exec", "env", "/bin/init/svc"]