-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile-development
29 lines (20 loc) · 965 Bytes
/
Dockerfile-development
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
FROM my-app-django-core
RUN ["apt-get", "install", "-y", "openssh-server"]
RUN ["apt-get", "install", "-y", "sudo"]
RUN mkdir /var/run/sshd
RUN echo 'root:password' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
# ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# fix for pycharm debug ssh connection
RUN echo "KexAlgorithms=diffie-hellman-group1-sha1" >> /etc/ssh/sshd_config
# Allows sshd to read /root/.ssh/environment
RUN echo "PermitUserEnvironment=yes" >> /etc/ssh/sshd_config
EXPOSE 22
RUN touch /root/.bash_profile
RUN echo "cd /app" >> /root/.bash_profile
RUN mkdir /root/.ssh/
RUN touch /root/.ssh/environment
CMD env >> /root/.ssh/environment; export -p | grep _ >> /etc/profile; /usr/sbin/sshd -D;