Skip to content

Commit 573f593

Browse files
add ssh service (#39)
1 parent cc8c10c commit 573f593

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

ssh_service/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ubuntu:22.04
2+
3+
WORKDIR /
4+
5+
USER root
6+
RUN apt-get update \
7+
&& apt-get install -y curl sudo
8+
9+
# Install ttyd
10+
RUN curl -LO https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 \
11+
&& mv ttyd.* /usr/local/bin/ttyd \
12+
&& chmod +x /usr/local/bin/ttyd

ssh_service/service_spec.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
spec:
2+
container:
3+
- name: main
4+
image: $IMAGE_URL
5+
command:
6+
- /bin/bash
7+
args:
8+
- -c
9+
- "(ttyd -p 9090 -W bash &> /tmp/ttyd.log &);tail -f /tmp/ttyd.log"
10+
endpoint:
11+
- name: ttyd
12+
port: 9090
13+
public: true

ssh_service/service_start.sql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
create service SSH_SERVICE
2+
in compute pool $COMPUTE_POOL
3+
from specification '
4+
spec:
5+
container:
6+
- name: main
7+
image: $IMAGE_URL
8+
command:
9+
- /bin/bash
10+
args:
11+
- -c
12+
- "(ttyd -p 9090 -W bash &> /tmp/ttyd.log &);tail -f /tmp/ttyd.log"
13+
endpoint:
14+
- name: ttyd
15+
port: 9090
16+
public: true
17+
';

0 commit comments

Comments
 (0)