-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (55 loc) · 2.22 KB
/
Dockerfile
File metadata and controls
69 lines (55 loc) · 2.22 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# sshd
#
# VERSION 0.0.3
FROM ubuntu:14.04
MAINTAINER InteractiveShell Team <[email protected]>
# For ssh server and up-to-date ubuntu.
RUN apt-get update && apt-get install -yq openssh-server wget emacs
RUN apt-get upgrade -y
# Installing M2
RUN echo "deb http://www.math.uiuc.edu/Macaulay2/Repositories/Ubuntu trusty main" >> /etc/apt/sources.list
RUN wget http://www.math.uiuc.edu/Macaulay2/PublicKeys/Macaulay2-key
RUN apt-key add Macaulay2-key
RUN apt-get update && apt-get install -y macaulay2
# RUN apt-get install -y polymake ## too long and big
RUN apt-get install -y graphviz
# M2 userland, part 1.
RUN useradd -m -d /home/m2user m2user
RUN mkdir /custom
RUN chown -R m2user:m2user /custom
RUN chmod -R 775 /custom
# Bertini and PHCpack
ENV PHC_VERSION 24
RUN (cd /custom; wget http://www.math.uic.edu/~jan/x86_64phcv${PHC_VERSION}p.tar.gz)
RUN (cd /custom; tar zxf x86_64phcv23p.tar.gz; mv phc /usr/bin; rm x86_64phcv${PHC_VERSION}p.tar.gz)
# This is the only way extracting Bertini gives the right permissions.
RUN su m2user -c "/bin/bash;\
cd /custom;\
wget https://bertini.nd.edu/BertiniLinux64_v1.5.tar.gz;\
tar xzf BertiniLinux64_v1.5.tar.gz;"
RUN ln -s /custom/BertiniLinux64_v1.5/bin/bertini /usr/bin/
##### M2 userland
RUN mkdir /home/m2user/.ssh
COPY docker_key.pub /home/m2user/.ssh/authorized_keys
COPY ssh_config /etc/ssh/ssh_config
COPY sshd_config /etc/ssh/sshd_config
RUN chown root:root /etc/ssh/ssh_config
RUN chmod 644 /etc/ssh/ssh_config
RUN chown root:root /etc/ssh/sshd_config
RUN chmod 600 /etc/ssh/sshd_config
RUN chown -R m2user:m2user /home/m2user/.ssh
RUN chmod 700 /home/m2user/.ssh
RUN chmod 644 /home/m2user/.ssh/authorized_keys
RUN sed -i 's/m2user:!/m2user:*/' /etc/shadow
# copy open
COPY open /usr/bin/open
RUN ln -s /usr/bin/open /usr/bin/display
### Tweaks to ssh setup ###
RUN mkdir /var/run/sshd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin no/' /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
EXPOSE 22
# CMD ["/usr/sbin/sshd", "-D"]