-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
96 lines (77 loc) · 2.04 KB
/
docker-compose.yml
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
# Steps for testing connection from phusion:
# winpty docker exec -it phusion bash
# 1. Test: native key to apptest:
# ssh -i /etc/ssh/ssh_host_rsa_key root@apptest
# 2. Test: calcium key to dev:
# ssh -i /service/ssh/id_rsa_dev root@dev
# 3. Test: native key to sge:
# ssh -i /etc/ssh/ssh_host_rsa_key sgeuser@sge
# 4. Test: calcium key to sge-server:
# ssh -i /service/ssh/id_rsa_dev sgeuser@sge-server
####################################################
# check local SSH connection:
# ssh -i key/id_rsa root@localhost -p 2222
services:
phusion:
build:
context: ./image
image: phusionimg
container_name: phusion
volumes:
- shared-data:/shared
- ./keys:/service/ssh/
command: /bin/bash -c "
cp /etc/ssh/ssh_host_rsa_key.pub /shared/id_rsa.pub && \
/usr/sbin/sshd -D"
# 1.
apptest:
image: phusionimg
depends_on:
- phusion
container_name: apptest
ports:
- "2222:22"
volumes:
- shared-data:/shared
command: /bin/bash -c "
cat /shared/id_rsa.pub >> /root/.ssh/authorized_keys && \
/usr/sbin/sshd -D"
# 2.
dev:
image: phusionimg
depends_on:
- phusion
container_name: dev
stdin_open: true
tty: true
volumes:
- ./keys:/service/ssh/
command: /bin/bash -c "
mkdir -p /home/sgeuser/.ssh && \
cat /service/ssh/id_rsa_dev.pub >> /root/.ssh/authorized_keys && \
/usr/sbin/sshd -D"
# 3.
sge:
image: diixo/sge-base:latest
pull_policy: always
container_name: sge
stdin_open: true
tty: true
volumes:
- shared-data:/shared
command: /bin/bash -c "
mkdir -p /home/sgeuser/.ssh && \
touch /home/sgeuser/.ssh/authorized_keys && \
cat /shared/id_rsa.pub >> /home/sgeuser/.ssh/authorized_keys && \
/usr/sbin/sshd -D"
# 4.
sge-server:
image: diixo/sge-ssh:latest
pull_policy: always
hostname: sge-server
container_name: sge-server
stdin_open: true
tty: true
command: /bin/bash -c "/usr/sbin/sshd -D"
volumes:
shared-data: