Skip to content

Commit

Permalink
Add a Dockerfile and opam metadata for convenient packaging
Browse files Browse the repository at this point in the history
The `opam` metadata permits the system to be installed via the
[OPAM](https://opam.ocaml.org) source manager.  The Dockerfile
allows the installation of the compiler without having to install
all the dependencies locally.

```
docker run -v `pwd`/tests:/src motto -q --parser_test_file flick_code/types_process.cp
```

Signed-off-by: Anil Madhavapeddy <[email protected]>
  • Loading branch information
avsm committed Jun 1, 2016
1 parent 38af4fa commit 457fd38
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ocaml/opam:alpine
COPY . /home/opam/src
RUN sudo chown -R opam /home/opam/src
WORKDIR /home/opam/src
RUN opam pin add -n motto /home/opam/src
RUN opam depext -uy --noninteractive motto
RUN opam install -j 2 -v -y motto
VOLUME /src
WORKDIR /src
ENTRYPOINT ["opam","config","exec","--","motto"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ If compilation fails, check that you have all dependencies listed in the
Try running `./motto.byte -h` to see if you have a binary. See the section on
"Testing" for how to run the tool over regression tests.

## Using Docker

If you have [Docker](http://docker.com) installed, you can also use a container
to run the compiler without installing all the dependencies. The source code
can be mounted in `/src` within the container.

```
$ docker build -t motto .
$ docker run -v `pwd`/tests:/src motto -q --parser_test_file flick_code/types_process.cp
```

# Getting going
We start with the mathematical cousin of "Hello, world" -- i.e., the factorial
Expand Down
3 changes: 3 additions & 0 deletions motto.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin: [
"?_build/motto.byte" {"motto"}
]
21 changes: 21 additions & 0 deletions opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
opam-version: "1.2"
maintainer: "Nik Sultana"
authors: [
"Richard G. Clegg"
"Masoud Koleini"
"Matteo Migliavacca"
"Nik Sultana"
]
homepage: "https://github.com/NaaS/motto"
dev-repo: "https://github.com/NaaS/motto.git"
bug-reports: "https://github.com/NaaS/motto/issues"
license: "Apache2"
build: ["./build.sh"]
install: []
remove: []
depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
"menhir"
]
available: [ocaml-version >= "4.01.0"]

0 comments on commit 457fd38

Please sign in to comment.