Skip to content

Commit

Permalink
add docker makefile target
Browse files Browse the repository at this point in the history
  • Loading branch information
opqrs committed Jun 3, 2020
1 parent ec500f1 commit 6812cd7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.git
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu
RUN apt-get update
RUN apt-get upgrade -y
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y opam build-essential libgmp-dev z3 pkg-config zlib1g-dev
RUN mkdir /etc/sudoers.d/ && \
echo 'opam ALL=(ALL:ALL) NOPASSWD:ALL' > /etc/sudoers.d/opam && \
chmod 440 /etc/sudoers.d/opam && \
chown root:root /etc/sudoers.d/opam && \
adduser --disabled-password --gecos '' opam && \
passwd -l opam && \
chown -R opam:opam /home/opam
USER opam
ENV HOME /home/opam
WORKDIR /home/opam
RUN opam init --disable-sandboxing
RUN eval `opam env` && \
opam repository add rems https://github.com/rems-project/opam-repository.git && \
opam install -y sail
COPY --chown=opam docker_entry_point.sh /home/opam/
RUN chmod +x docker_entry_point.sh
WORKDIR /data
ENTRYPOINT ["/home/opam/docker_entry_point.sh"]
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all sail language clean archs isabelle-lib apply_header
.PHONY: all sail language clean archs isabelle-lib apply_header docker

INSTALL_DIR ?= .

Expand Down Expand Up @@ -86,3 +86,7 @@ clean:
$(MAKE) -C "$$subdir" clean;\
done
rm -f sail

docker:
docker build --tag sail:0.1 .
@echo 'for example: docker run --volume `PWD`:/data/ sail:0.1 --help'
2 changes: 2 additions & 0 deletions docker_entry_point.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
eval `opam env` && sail $*

0 comments on commit 6812cd7

Please sign in to comment.