-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.Dockerfile
53 lines (45 loc) · 1.28 KB
/
dev.Dockerfile
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
# CLion remote docker environment (How to build docker container, run and stop it)
#
# Build and run:
# docker build -t media-server/remote-cpp-env -f dev.Dockerfile .
# docker run -d --cap-add sys_ptrace -p127.0.0.1:2222:22 --name media_server_remote_env media-server/remote-cpp-env
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2222"
#
# stop:
# docker stop media_server_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 \
sudo \
build-essential \
gcc \
g++ \
gdb \
clang \
cmake \
rsync \
tar \
python \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libavutil-dev \
&& 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 \
&& adduser user sudo
RUN usermod -s /bin/bash user
EXPOSE 8080
EXPOSE 4577/udp
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]