-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
37 lines (29 loc) · 1.47 KB
/
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
#
# million12/php-app-ssh
#
FROM million12/nginx-php:latest
MAINTAINER Marcin Ryzycki [email protected]
RUN \
`# Install OpenSSH server` \
yum install -y openssh-server pwgen sudo vim mc links && \
yum clean all && \
`# Configure SSH daemon...` \
sed -i -r 's/.?UseDNS\syes/UseDNS no/' /etc/ssh/sshd_config && \
sed -i -r 's/.?PasswordAuthentication.+/PasswordAuthentication no/' /etc/ssh/sshd_config && \
sed -i -r 's/.?UsePAM.+/UsePAM no/' /etc/ssh/sshd_config && \
sed -i -r 's/.?ChallengeResponseAuthentication.+/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config && \
sed -i -r 's/.?PermitRootLogin.+/PermitRootLogin no/' /etc/ssh/sshd_config && \
`# Remove 'Defaults secure_path' from /etc/sudoers which overrides path when using 'sudo' command` \
sed -i '/secure_path/d' /etc/sudoers && \
`# Add 'www' user to sudoers` \
echo 'www ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/www && \
`# Remove non-necessary files and Supervisord services from parent million12/nginx-php image` \
rm -rf /config/init/*-{nginx,php}-*.sh /etc/supervisor.d/{nginx,php-fpm}.conf && \
`# Remove warning about missing locale while logging in via ssh` \
echo > /etc/sysconfig/i18n
# Add config/init scripts to run after container has been started
ADD container-files /
EXPOSE 22
# Run container with following ENV variable to add listed users' keys from GitHub.
# Note: separate with coma, space is not allowed here!
#ENV IMPORT_GITHUB_PUB_KEYS github,usernames,coma,separated