-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-alpine.dev
41 lines (35 loc) · 1.35 KB
/
Dockerfile-alpine.dev
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
# CLion remote docker environment (How to build docker container, run and stop it)
#
# Build and run:
# docker build -t mqumairi/poco-dev -f Dockerfile-alpine.dev .
# docker run -d --cap-add sys_ptrace --privileged -p 2222:22 -p 7777:7777 mqumairi/poco-dev
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2222"
#
# stop:
# docker stop mqumairi/poco-dev
#
# ssh credentials (test user):
# root@root
FROM alpine
RUN apk add --update openssh gcc g++ clang gdb cmake make ninja autoconf automake dos2unix tar rsync python3 \
bash git curl iputils poco-dev protobuf openssl openssl-dev libpq postgresql mysql unixodbc \
&& rm -rf /tmp/* /var/cache/apk/*
RUN echo "root:root" | chpasswd
RUN ( \
echo 'Port 22'; \
echo '#AddressFamily any'; \
echo '#ListenAddress 0.0.0.0'; \
echo '#ListenAddress ::'; \
echo 'HostKey /etc/ssh/ssh_host_rsa_key'; \
echo 'HostKey /etc/ssh/ssh_host_dsa_key'; \
echo 'HostKey /etc/ssh/ssh_host_ecdsa_key'; \
echo 'HostKey /etc/ssh/ssh_host_ed25519_key'; \
echo 'PermitRootLogin yes'; \
echo '#PasswordAuthentication yes'; \
echo 'AuthorizedKeysFile .ssh/authorized_keys'; \
echo 'Subsystem sftp /usr/lib/ssh/sftp-server'; \
) > /etc/sshd_config_test_clion
RUN /usr/bin/ssh-keygen -A
RUN ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_key
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-f", "/etc/sshd_config_test_clion"]