-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (51 loc) · 2 KB
/
Dockerfile
File metadata and controls
62 lines (51 loc) · 2 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
FROM debian:stable-slim
ARG PYVER=2.7.18
# probably doubles the build time, but if you want it set to '1'
ARG PYOPTIMIZED=
ENV DEBIAN_FRONTEND=noninteractive
ENV BUILD_PACKAGES="build-essential wget git ca-certificates zlib1g-dev libssl-dev"
RUN apt-get update
RUN apt-get install -y --no-install-recommends $BUILD_PACKAGES
# mark as "manually installed" so it isn't autoremoved later
RUN apt-get install -y --no-install-recommends make less vim-tiny
WORKDIR /usr/src
RUN wget --no-verbose https://www.python.org/ftp/python/$PYVER/Python-$PYVER.tgz
# source: https://www.python.org/downloads/release/python-2718
RUN echo "38c84292658ed4456157195f1c9bcbe1 Python-$PYVER.tgz" > MD5SUMS
RUN md5sum -c MD5SUMS && rm MD5SUMS
RUN tar xzf Python*
WORKDIR Python-$PYVER
# `--enable-optimizations` here runs a lot of tests, and we don't really care
# h/t: https://stackoverflow.com/a/44800991
RUN if [ $PYOPTIMIZED -eq 1 ]; then ./configure --enable-optimizations; else ./configure; fi
RUN make -j8 && make install
# source: https://pip.pypa.io/en/stable/installation (more or less)
RUN wget --no-verbose https://bootstrap.pypa.io/pip/2.7/get-pip.py
RUN python get-pip.py
# the rest of these are all things that `make install` would do for you,
# *outside* the container
WORKDIR /usr/src
RUN git clone https://github.com/jhkorhonen/MOODS.git
WORKDIR MOODS
RUN git checkout de2a2a8
WORKDIR src
RUN make -j8
WORKDIR ../python
RUN python setup.py install
WORKDIR /usr/src
COPY README.md requirements.txt Makefile setup.py cosmo.py cosmostats.py ./
RUN python setup.py install
WORKDIR /usr/local/bin
RUN ln -s cosmo.py cosmo
RUN ln -s cosmostats.py cosmostats
RUN rm -r /usr/src
RUN apt-get remove -y $BUILD_PACKAGES && \
apt-get autoremove -y && \
apt-get clean -y
COPY examples/jpwm /usr/local/cosmo/jpwm
# this will probably match the local user, 1000:1000, avoiding problems with
# files created by root within the container
RUN useradd -m cosmo
USER cosmo
RUN echo 'export COSMO_PWMDIR=/usr/local/lib/cosmo/jpwm' >> ~/.bashrc
WORKDIR /src