-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
86 lines (86 loc) · 3.43 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Temporary container for building BNFC
FROM haskell:8 as bnfc-build
RUN cabal update
RUN cabal install happy alex
WORKDIR /var/tmp/bnfc
ARG BNFC_COMMIT=ce7fe1fd08d9d808c14ff626c321218c5b73e38b
RUN git clone https://github.com/BNFC/bnfc . && git checkout $BNFC_COMMIT
RUN stack init && stack setup
RUN stack build && stack install --local-bin-path=.
# Container for building RChain
# bionic = 18.04
FROM ubuntu:bionic
RUN apt update \
&& apt install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
locales \
lsb-release \
software-properties-common \
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& echo 'deb https://repo.scala-sbt.org/scalasbt/debian all main' > /etc/apt/sources.list.d/sbt.list \
&& echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" >/etc/apt/sources.list.d/docker-ce.list \
&& echo 'deb https://packages.cloud.google.com/apt cloud-sdk main' >/etc/apt/sources.list.d/google-cloud-sdk.list \
&& echo "deb https://packages.cloud.google.com/apt gcsfuse-$(lsb_release -cs) main" >/etc/apt/sources.list.d/gcsfuse.list
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PYENV_ROOT=/opt/pyenv
RUN apt-add-repository ppa:git-core/ppa
RUN apt update \
&& apt install -y --no-install-recommends \
build-essential \
docker-ce-cli \
fakeroot \
gcsfuse \
git \
java-common \
jflex \
jq \
libbz2-dev \
libffi-dev \
liblzma-dev \
libsqlite3-dev \
libssl-dev \
lintian \
moreutils \
openjdk-11-jdk-headless \
python-crcmod \
python3 \
python3-pip \
python3-dev \
rpm \
sbt=1.\* \
sudo \
zlib1g-dev \
&& update-java-alternatives --set java-1.11.0-openjdk-amd64 \
&& pip3 install -U setuptools pip \
&& hash -r \
&& pip3 install -U \
pipenv \
pyyaml \
requests \
&& curl -fsSL https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash \
&& echo 'builder ALL = (ALL) NOPASSWD: ALL' >/etc/sudoers.d/builder \
&& groupadd -g 1000 builder \
&& useradd -m -s /bin/bash -u 1000 -g 1000 builder \
&& for dir in \
/tmp \
/var/cache \
/var/lib/apt/lists \
/var/tmp \
~/.cache \
; do [ ! -d $dir ] || find $dir -mindepth 1 -delete; done
ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
COPY --from=bnfc-build /var/tmp/bnfc/bnfc /usr/local/bin/
WORKDIR /work
# Workaround bug in sbt <= 1.3.5. See https://github.com/sbt/sbt-launcher-package/blob/aa6ce25a865632c628e0986c7204d419f086152d/src/universal/bin/sbt
# lines 378 and 341. The execRunner call never returns, so the very first run
# of sbt just says "Copying runtime jar." and exits. This command should be
# removed when it's fixed in sbt as it will then download full sbt runtime that
# will most likely differ from that defined in RChain project (sbt.properties).
RUN dpkg --compare-versions "$(dpkg-query -W -f '${Version}' sbt)" ge 1.3.6 \
|| sbt --version