Skip to content

Instantly share code, notes, and snippets.

@deeso
Last active August 29, 2015 14:02
Show Gist options
  • Save deeso/b3b32922686ec3d96827 to your computer and use it in GitHub Desktop.
Save deeso/b3b32922686ec3d96827 to your computer and use it in GitHub Desktop.
Docker file for vmkit
# using phusion/baseimage as base image.
FROM phusion/baseimage
# Set correct environment variables.
ENV HOME /root
# Regenerate SSH host keys. baseimage-docker does not contain any
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# create code directory
RUN mkdir /opt/code/
# install packages required to compile vala and radare2
RUN apt-get update
RUN apt-get install -y software-properties-common python-all-dev wget
RUN apt-get install -y swig flex bison git gcc g++ make pkg-config glib-2.0
RUN apt-get install -y python-gobject-dev wget subversion libgconf2-dev antlr
RUN apt-get install -y gcj-4.8-jdk texinfo texi2html autotools-dev autoconf libtool
RUN apt-get install -y libgtk2.0-dev openjdk-6-jdk ant
# compile vala
#RUN cd /opt/code; wget http://download.gnome.org/sources/vala/0.24/vala-0.24.0.tar.xz; tar -Jxf vala-0.24.0.tar.xz
#RUN cd /opt/code/vala-0.24.0; ./configure --prefix=/usr ; make && make install
# compile radare
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./configure --prefix=/usr; make && make install
#download Clang and LLVM 3.3
RUN cd /opt/code; wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz;
RUN cd /opt/code; wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz;
RUN cd /opt/code; tar zxvf llvm-3.3.src.tar.gz;
RUN cd /opt/code/llvm-3.3.src/tools; tar zxvf ../../cfe-3.3.src.tar.gz; mv cfe-3.3.src clang;
RUN cd /opt/code/llvm-3.3.src/; ./configure --enable-optimized; make REQUIRES_RTTI=1
# download and build classpath
RUN cd /opt/code/; git clone git://git.sv.gnu.org/classpath.git
RUN cd /opt/code/classpath/; sh autogen.sh; ./configure --disable-plugin --disable-examples --disable-Werror; make
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/java-io/.libs/libjavaio.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/java-lang/.libs/libjavalangreflect.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/java-lang/.libs/libjavalang.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/java-net/.libs/libjavanet.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/java-nio/.libs/libjavanio.so;
RUN cd /opt/code/classpath/lib; ln -s ../native/jni/java-util/.libs/libjavautil.so;
# download and compile vmkit
RUN cd /opt/code/; svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit
RUN export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/;cd /opt/code/vmkit; ./configure --with-llvm-config-path=/opt/code/llvm-3.3.src/Release+Asserts/bin/llvm-config --with-gnu-classpath-glibj=/opt/code/classpath/lib/glibj.zip --with-gnu-classpath-libs=/opt/code/classpath/lib/; make
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment