Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A Dockerfile for working through Real World Ocaml
# See
FROM ocaml/opam
# Get core set up
RUN opam depext -i core
# Do some extra stuff to make cryptokit happy
RUN opam depext conf-zlib.1 && opam depext conf-gmp.1 && opam install cryptokit
# Install all the packages the book uses, including the utop REPL
RUN opam install utop async yojson core_extended core_bench cohttp async_graphics menhir
# Tell utop how to boot up with all the important functions you want
RUN echo '#use "topfind";; #thread;; #camlp4o;; #require "";; #require "core.syntax";; open Core.Std' > ~/.ocamlinit

This comment has been minimized.

Copy link
Owner Author

joefraley commented May 7, 2017

To get started:

$ git clone # this gist
# Builds on the commands
$ docker build -t ocaml-core .
$ docker run -ti ocaml-core bash

I also recommend mounting a local directory where you can write all your fancy new Ocaml in your preferred editor, but give Docker access to them to build and run:

$ mkdir ~/real-world-ocaml
# mounts your local machine directory to /real-world-ocaml in your container.
# See
$ docker run -ti ocaml-core bash -v ~/real-world-ocaml:/real-world-ocaml 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.