-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.remote
52 lines (43 loc) · 1.17 KB
/
Dockerfile.remote
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
# CLion remote docker environment (How to build docker container, run and stop it)
#
# Build and run:
# docker build -t remote -f Dockerfile.remote .
# docker run -d --cap-add sys_ptrace -p127.0.0.1:2222:22 --name remote_env remote
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2222"
#
# stop:
# docker stop remote_env
#
# ssh credentials (test user):
# user@password
FROM ubuntu:20.04
RUN DEBIAN_FRONTEND="noninteractive" apt-get update && apt-get -y install tzdata
RUN apt-get update \
&& apt-get install -y ssh \
build-essential \
gcc \
g++ \
gdb \
clang \
cmake \
rsync \
tar \
python \
iputils-ping \
vim \
git \
tcpdump \
net-tools \
&& apt-get clean
RUN ( \
echo 'LogLevel DEBUG2'; \
echo 'PermitRootLogin yes'; \
echo 'PasswordAuthentication yes'; \
echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \
) > /etc/ssh/sshd_config_test_clion \
&& mkdir /run/sshd
RUN useradd -m user \
&& yes password | passwd user
RUN yes password | passwd root
RUN usermod -s /bin/bash user
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]