Skip to content

Commit

Permalink
Dockerfile: install python, make cc0 work
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cg2v committed Aug 3, 2015
1 parent 88d8046 commit 71ceb49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 4 additions & 5 deletions autodriver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
FROM ubuntu:14.04
MAINTAINER Mihir Pandya <[email protected]>

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
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
Expand Down
3 changes: 3 additions & 0 deletions autodriver/cc0wrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec /usr/local/cc0/bin/cc0 $@

0 comments on commit 71ceb49

Please sign in to comment.