-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (31 loc) · 1.17 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
38
39
# docker build . -t cppack
# docker run -d --name gsg -p 5022:22 cppack
# ssh -X -p 5022 [email protected] /opt/cppack/bin/cppack-gui
FROM ubuntu:bionic
ENV SSH_PASSWORD "rootpass"
RUN apt-get -qq update
RUN apt-get -qq -y install \
build-essential \
cmake \
qt5-default \
libqt5charts5-dev \
supervisor \
openssh-server \
>/dev/null
# Install SSH access
RUN mkdir /var/run/sshd && \
echo "root:$SSH_PASSWORD" | chpasswd && \
sed -i 's/^.*PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
# Configure supervisor
RUN mkdir -p /var/log/supervisor && \
echo "[supervisord]" >> /etc/supervisor/conf.d/supervisord.conf && \
echo "nodaemon=true" >> /etc/supervisor/conf.d/supervisord.conf && \
echo "[program:sshd]" >> /etc/supervisor/conf.d/supervisord.conf && \
echo "command=/usr/sbin/sshd -D" >> /etc/supervisor/conf.d/supervisord.conf
COPY . /opt/cppack
WORKDIR /opt/cppack
RUN cmake . && make -s
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf" ]
EXPOSE 22