From 71ceb49a61bbb7db7252dba2d5a578d545092610 Mon Sep 17 00:00:00 2001 From: Chaskiel Grundman Date: Sun, 2 Aug 2015 16:44:25 -0400 Subject: [PATCH] Dockerfile: install python, make cc0 work install python2 so interface script can use #!/usr/bin/python Install all of C0's files, and use a wrapper shell script for cc0 so the compiler is always invoked with an absolute path --- autodriver/Dockerfile | 9 ++++----- autodriver/cc0wrap.sh | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 autodriver/cc0wrap.sh diff --git a/autodriver/Dockerfile b/autodriver/Dockerfile index 7cb0c15c..b36fb2a4 100644 --- a/autodriver/Dockerfile +++ b/autodriver/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:14.04 MAINTAINER Mihir Pandya -RUN apt-get update && apt-get install -y build-essential wget +RUN apt-get update && apt-get install -y build-essential wget python # Install autodriver WORKDIR /home @@ -11,17 +11,16 @@ RUN useradd autolab && useradd autograde RUN mkdir autolab autograde output && chown autolab:autolab autolab output && chown autograde:autograde autograde ADD . /home/autodriver WORKDIR /home/autodriver -RUN make clean && make && install -c -o root -g root -m 4755 autodriver /usr/bin/autodriver && install -c -m 755 autograde_wrapper.py /usr/bin/autograde_wrapper +RUN make clean && make && install -c -o root -g root -m 4755 autodriver /usr/bin/autodriver && install -c -m 755 autograde_wrapper.py /usr/bin/autograde_wrapper && cp cc0wrap.sh /usr/bin/cc0 && chmod +x /usr/bin/cc0 ENTRYPOINT ["/usr/bin/autograde_wrapper"] # Install C0 WORKDIR /home RUN wget http://c0.typesafety.net/dist/cc0-v0440-linux3.18.1-64bit-bin.tgz -RUN tar -xvzf cc0-* -WORKDIR /home/cc0 +RUN tar -C /usr/local -xvzf cc0-* +WORKDIR /usr/local/cc0 RUN bin/cc0 -d doc/src/exp.c0 doc/src/exp-test.c0 #RUN ./a.out -RUN cp bin/cc0 /usr/bin/cc0 # Clean up WORKDIR /home diff --git a/autodriver/cc0wrap.sh b/autodriver/cc0wrap.sh new file mode 100644 index 00000000..4a14c111 --- /dev/null +++ b/autodriver/cc0wrap.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/local/cc0/bin/cc0 $@