This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
66 lines (52 loc) · 1.86 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
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
ARG NODE_VERSION=8.15.1
FROM node:$NODE_VERSION
# Using these to provide advanced pruning later
LABEL org="Freedom of the Press"
LABEL image_name="sunder"
# Supports building as normal user. Assumes UID of 1000,
# will need to handle USER_ID otherwise. The "node" user
# has uid 1000 by default.
ARG UID
ENV UID ${UID:-1000}
RUN apt-get update && apt-get upgrade -y # 2018-02-08 && \
rm -rf /var/cache/apt/archives/*
# Required for electron-builder:
# https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux
RUN apt-get install -y --no-install-recommends \
graphicsmagick \
icnsutils \
libgconf2-dev \
libgtk2.0-dev \
libnss3-dev \
sudo \
xz-utils && \
rm -rf /var/cache/apt/archives/*
# Required for starting electron
RUN apt-get install -y --no-install-recommends \
libgtk-3-0 \
libx11-xcb1 \
libxtst6 \
libxss1 \
libasound2 \
xvfb xauth \
&& rm -rf /var/cache/apt/archives/*
# Install python for building docs with sphinx
RUN apt-get update && \
apt-get install -y python python-dev python-pip python-virtualenv && \
rm -rf /var/cache/apt/archives/*
# Install sphinx and related python requirements
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt && \
rm /tmp/requirements.txt
RUN if test $UID != 1000 ; then usermod -u $UID node; fi && echo "node ALL=(ALL) NOPASSWD:/bin/sunder-perm-fix" >> /etc/sudoers
# For compatibility with grsecurity-patched kernels and perm clean-up
RUN apt-get install -y paxctl && \
paxctl -Cm /usr/local/bin/node && \
rm -rf /var/cache/apt/archives/*
COPY tools/sunder-perm-fix.sh /bin/sunder-perm-fix
RUN chmod +x /bin/sunder-perm-fix
WORKDIR /sunder
USER node
# Install Rust under `node` user home directory
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
CMD /sunder/tools/build-sunder-debian-packages.sh