forked from rc2sql/rc2sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
82 lines (65 loc) · 2.51 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
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get upgrade -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y automake bc bison ca-certificates clang flex git libgmp3-dev libssl-dev locales make mysql-server mysql-client m4 opam openjdk-8-jdk postgresql postgresql-contrib python3 python3-setuptools texlive vim
RUN adduser --disabled-password --gecos "" rcsql
RUN locale-gen en_US.UTF-8 &&\
echo "export LANG=en_US.UTF-8 LANGUAGE=en_US.en LC_ALL=en_US.UTF-8" >> /home/rcsql/.bashrc
USER rcsql
ENV WDIR /home/rcsql
ENV LDDIR ${WDIR}/ldd-r6438
WORKDIR ${WDIR}
RUN opam init -y --disable-sandboxing
RUN opam install -y ocamlbuild ocamlfind dune dune-build-info menhir qcheck zarith
RUN opam switch create 4.05.0
RUN opam switch default
# MonPoly/VeriMon
RUN git clone https://bitbucket.org/jshs/monpoly.git
RUN eval `opam config env`; cd monpoly; dune build --release; dune install
# local files
ADD . ${WDIR}
USER root
RUN chmod 755 /home/rcsql
RUN chown -R rcsql:rcsql *
USER rcsql
# Amazon
RUN make -C amazon
# MonPoly-REG
RUN cd /home/rcsql/monpoly-reg-1.0/src/mona; ./configure; make
USER root
RUN cd /home/rcsql/monpoly-reg-1.0/src/mona; make install
USER rcsql
RUN opam switch 4.05.0; eval `opam config env`; cd monpoly-reg-1.0; make
RUN opam switch default
# DDD
RUN make -C dddlib
RUN make -C ddd-rc
USER root
RUN cp /home/rcsql/dddlib/lib/* /usr/local/lib
USER rcsql
# LDD
RUN cd ldd-r6438; ./configure; make
RUN make -C ldd-rc
# Ailamazyan et al.
RUN eval `opam config env`; make -C ailamazyan/src
# radb
USER root
RUN cd radb; python3 setup.py build; python3 setup.py install
USER rcsql
# RC2SQL/VGTrans
RUN eval `opam config env`; make -C src
# Tools
RUN make -C tools
# PostgreSQL
USER root
RUN find /etc/postgresql -name "postgresql.conf" | xargs sed -i "s/.enable_nestloop = on/enable_nestloop = off/"
# MySQL
RUN usermod -d /var/lib/mysql mysql
RUN echo '[mysqld]' >> /etc/mysql/my.cnf
RUN echo 'local-infile=1' >> /etc/mysql/my.cnf
# Startup
RUN echo 'export LD_LIBRARY_PATH=/usr/local/lib' >> /home/rcsql/.bashrc
RUN echo 'alias mysql="mysql -h 127.0.0.1 -P 3306 -u rcsql"' >> /home/rcsql/.bashrc
RUN echo "/etc/init.d/postgresql start; su - postgres -c 'psql --command \"CREATE ROLE rcsql WITH SUPERUSER LOGIN;\"'; su - postgres -c 'psql --command \"CREATE DATABASE rcsql;\"'" >> /root/.bashrc
RUN echo '/etc/init.d/mysql start; mysql -e "CREATE DATABASE db;"; mysql -e "CREATE USER rcsql@localhost;"; mysql -e "GRANT ALL ON *.* to rcsql@localhost;"' >> /root/.bashrc
RUN echo 'su - rcsql' >> /root/.bashrc