-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.76 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1.76 KB
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
FROM ubuntu:18.04
MAINTAINER Iuliana Cosmina "iuliana@cloudsoft.io"
# CONTAINER_SERVICE_VERSION_BELOW
LABEL version="2.0.0-SNAPSHOT"
# setup locale
RUN type locale-gen ; if [ "$?" -eq "0" ] ; then locale-gen en_US.UTF-8 ; fi
# setup root account with temporary password (optionally overridden in docker-entrypoint.sh)
RUN echo 'root:p4ssw0rd' | chpasswd
# install sshd
RUN apt-get update ; \
apt-get install -y --no-install-recommends apt-utils ;\
apt-get install -y openssh-server sudo; \
mkdir /var/run/sshd ; \
chmod 600 /var/run/sshd
# create host keys if absent
RUN if [ -f "/etc/ssh/ssh_host_dsa_key" -a -f "/etc/ssh/ssh_host_rsa_key" ] ; then \
echo "SSH host private keys already exists" ; \
else \
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa -b 4096; \
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa; \
fi
# configure sshd to allow login
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /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 || true
COPY docker-entrypoint.sh /
RUN chmod 700 /docker-entrypoint.sh
# Needed to support install of PostgreSQL 12 and MySQL 5.7
RUN which curl || apt -y install curl
RUN export DEBIAN_FRONTEND=noninteractive
RUN echo exit 0 > /usr/sbin/policy-rc.d
RUN apt-get install -y openssh-server netbase perl libnuma1 psmisc locales locales-all libxslt1.1
RUN ln -fs /usr/share/zoneinfo/Europe/Dublin /etc/localtime
RUN apt-get install -y tzdata
RUN dpkg-reconfigure --frontend noninteractive tzdata
RUN echo "$(date)" >> /tmp/image.info
EXPOSE 22
ENTRYPOINT ["/docker-entrypoint.sh"]