forked from JetBrains/clion-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.remote-cpp-env
40 lines (35 loc) · 1.01 KB
/
Dockerfile.remote-cpp-env
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
# CLion remote docker environment (How to build docker container, run and stop it)
#
# Build and run:
# docker build -t clion/remote-cpp-env:0.5 -f Dockerfile.remote-cpp-env .
# docker run -d --cap-add sys_ptrace -p127.0.0.1:2222:22 --name clion_remote_env clion/remote-cpp-env:0.5
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2222"
#
# stop:
# docker stop clion_remote_env
#
# ssh credentials (test user):
# user@password
FROM ubuntu:18.04
RUN apt-get update \
&& apt-get install -y ssh \
build-essential \
gcc \
g++ \
gdb \
clang \
cmake \
rsync \
tar \
python \
&& 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
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]