From 3cacae74a5f45601312e2c5dd776907aa70aaa46 Mon Sep 17 00:00:00 2001 From: gitoleg Date: Fri, 22 Mar 2019 14:07:09 -0400 Subject: [PATCH] updates vagrant/docker files (#928) * updates docker and vagrant files * added libncurses install * removed bubblewrap building from Dockerfiles * minor updates * quotes added * don't delete libncurses --- docker/debian/testing/Dockerfile | 38 +++++++++++++++++++++++--------- docker/trusty/testing/Dockerfile | 22 +++++++++++++----- docker/xenial/testing/Dockerfile | 19 +++++++++++++--- vagrant/jessie64/Vagrantfile | 24 +++++++++----------- vagrant/trusty64/Vagrantfile | 21 +++++++++++++----- vagrant/xenial64/Vagrantfile | 20 ++++++++++++----- 6 files changed, 100 insertions(+), 44 deletions(-) diff --git a/docker/debian/testing/Dockerfile b/docker/debian/testing/Dockerfile index 0354e29c1..ab57c96fd 100644 --- a/docker/debian/testing/Dockerfile +++ b/docker/debian/testing/Dockerfile @@ -1,16 +1,32 @@ -FROM ocaml/opam:debian +FROM ocaml/opam2:debian-stable + MAINTAINER Ivan Gotovchits + RUN sudo apt-get -y update && sudo apt-get -y install \ - llvm-3.8-dev \ + build-essential \ + curl \ git \ - libcurl4-gnutls-dev \ - libgmp-dev \ - zlib1g-dev \ - binutils-multiarch \ - clang -RUN opam init --auto-setup --comp=4.05.0 --yes + libx11-dev \ + m4 \ + pkg-config \ + python-pip \ + software-properties-common \ + sudo \ + unzip \ + wget \ + libcap-dev \ + gcc \ + make \ + libncurses5-dev + +RUN opam switch 4.05 +RUN eval "$(opam env)" RUN opam repo add bap git://github.com/BinaryAnalysisPlatform/opam-repository#testing -RUN LLVM_CONFIG=llvm-config-3.8 opam install conf-bap-llvm --yes -RUN OPAMJOBS=16 opam install bap --yes -RUN sudo apt-get install python-pip --yes +RUN opam update +RUN opam install depext --yes +RUN OPAMJOBS=1 opam depext --install bap --yes RUN sudo pip install bap + +WORKDIR /home/opam + +ENTRYPOINT ["opam", "config", "exec", "--"] diff --git a/docker/trusty/testing/Dockerfile b/docker/trusty/testing/Dockerfile index 43b150915..bc9f25f7d 100644 --- a/docker/trusty/testing/Dockerfile +++ b/docker/trusty/testing/Dockerfile @@ -1,5 +1,6 @@ FROM ubuntu:trusty MAINTAINER Ivan Gotovchits + RUN apt-get -y update && apt-get -y install \ build-essential \ curl \ @@ -11,20 +12,29 @@ RUN apt-get -y update && apt-get -y install \ software-properties-common \ sudo \ unzip \ - wget -RUN add-apt-repository --yes ppa:avsm/ppa && apt-get update && apt-get -y install \ - ocaml \ - ocaml-native-compilers \ - opam + wget \ + libcap-dev \ + gcc \ + make \ + libncurses5-dev + RUN useradd -m bap && echo "bap:bap" | chpasswd && adduser bap sudo RUN sed -i.bkp -e \ 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \ /etc/sudoers USER bap WORKDIR /home/bap -RUN opam init --auto-setup --comp=4.05.0 --yes + +RUN wget https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh +RUN echo "" | sh ./install.sh +RUN opam --version + +RUN opam init --yes --compiler=4.05.0 --disable-sandboxing +RUN eval "$(opam env)" RUN opam repo add bap git://github.com/BinaryAnalysisPlatform/opam-repository#testing RUN opam update +RUN opam install depext --yes RUN OPAMJOBS=1 opam depext --install bap --yes RUN sudo pip install bap + ENTRYPOINT ["opam", "config", "exec", "--"] diff --git a/docker/xenial/testing/Dockerfile b/docker/xenial/testing/Dockerfile index 3c31e6359..4f2341956 100644 --- a/docker/xenial/testing/Dockerfile +++ b/docker/xenial/testing/Dockerfile @@ -1,5 +1,6 @@ FROM ubuntu:xenial MAINTAINER Ivan Gotovchits + RUN apt-get -y update && apt-get -y install \ build-essential \ curl \ @@ -11,17 +12,29 @@ RUN apt-get -y update && apt-get -y install \ software-properties-common \ sudo \ unzip \ - wget -RUN apt-get -y install opam + wget \ + libcap-dev \ + gcc \ + make \ + libncurses5-dev + RUN useradd -m bap && echo "bap:bap" | chpasswd && adduser bap sudo RUN sed -i.bkp -e \ 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \ /etc/sudoers USER bap WORKDIR /home/bap -RUN opam init --auto-setup --comp=4.05.0 --yes + +RUN wget https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh +RUN echo "" | sh ./install.sh +RUN opam --version + +RUN opam init --yes --compiler=4.05.0 --disable-sandboxing +RUN eval "$(opam env)" RUN opam repo add bap git://github.com/BinaryAnalysisPlatform/opam-repository#testing RUN opam update +RUN opam install depext --yes RUN OPAMJOBS=1 opam depext --install bap --yes RUN sudo pip install bap + ENTRYPOINT ["opam", "config", "exec", "--"] diff --git a/vagrant/jessie64/Vagrantfile b/vagrant/jessie64/Vagrantfile index 537367c66..8f824ba0b 100644 --- a/vagrant/jessie64/Vagrantfile +++ b/vagrant/jessie64/Vagrantfile @@ -7,19 +7,17 @@ Vagrant.configure(2) do |config| vb.memory = "4096" end config.vm.provision "shell", privileged: false, inline: <<-SHELL -sudo apt-get -y update && sudo apt-get -y install \ - llvm-3.8-dev \ - git \ - libcurl4-gnutls-dev \ - libgmp-dev \ - zlib1g-dev \ - binutils-multiarch \ - clang \ - time -opam init --auto-setup --comp=4.05.0 --yes -eval `opam config env` -LLVM_CONFIG=llvm-config-3.8 opam install conf-bap-llvm --yes -opam install bap --yes +sudo apt-get update +sudo apt-get install curl make git m4 libcap-dev gcc unzip --yes + +echo "" | sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) + +yes | opam init --compiler=4.05.0 --disable-sandboxing +eval $(opam env) + +opam install depext --yes +opam depext bap -i --yes + sudo apt-get install python-pip --yes sudo pip install bap SHELL diff --git a/vagrant/trusty64/Vagrantfile b/vagrant/trusty64/Vagrantfile index d376f0c11..819709aa2 100644 --- a/vagrant/trusty64/Vagrantfile +++ b/vagrant/trusty64/Vagrantfile @@ -7,13 +7,22 @@ Vagrant.configure(2) do |config| vb.memory = "4096" end config.vm.provision "shell", privileged: false, inline: <<-SHELL -sudo add-apt-repository --yes ppa:avsm/ppa sudo apt-get update -sudo apt-get --yes install opam -opam init --auto-setup --comp=4.05.0 --yes -opam repo add bap git://github.com/BinaryAnalysisPlatform/opam-repository#bap-1.4 -eval `opam config env` -opam depext bap --install --yes +sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev --yes + +wget https://github.com/projectatomic/bubblewrap/releases/download/v0.3.1/bubblewrap-0.3.1.tar.xz +tar xvf bubblewrap-0.3.1.tar.xz +cd bubblewrap-0.3.1 +./configure && make && sudo make install +cd ../ + +echo "" | sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) +yes | opam init --compiler=4.05.0 +eval $(opam env) + +opam install depext --yes +opam depext bap -i --yes + sudo apt-get install python-pip --yes sudo pip install bap SHELL diff --git a/vagrant/xenial64/Vagrantfile b/vagrant/xenial64/Vagrantfile index 2fe4aad20..2bd751b67 100644 --- a/vagrant/xenial64/Vagrantfile +++ b/vagrant/xenial64/Vagrantfile @@ -8,11 +8,21 @@ Vagrant.configure(2) do |config| end config.vm.provision "shell", privileged: false, inline: <<-SHELL sudo apt-get update -sudo apt-get --yes install opam -opam init --auto-setup --comp=4.05.0 --yes -opam repo add bap git://github.com/BinaryAnalysisPlatform/opam-repository#bap-1.4 -eval `opam config env` -opam depext bap --install --yes +sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev --yes + +wget https://github.com/projectatomic/bubblewrap/releases/download/v0.3.1/bubblewrap-0.3.1.tar.xz +tar xvf bubblewrap-0.3.1.tar.xz +cd bubblewrap-0.3.1 +./configure && make && sudo make install +cd ../ + +echo "" | sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) +yes | opam init --compiler=4.05.0 +eval $(opam env) + +opam install depext --yes +opam depext bap -i --yes + sudo apt-get install python-pip --yes sudo pip install bap SHELL