Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to compile and run a Pony program using Docker

How to compile and run a Pony program using Docker

Create a /tmp/helloworld directory and put the following in main.pony:

actor Main
  new create(env: Env) =>
    env.out.print("Hello, world!")

Now compile it like this (the Docker image will be downloaded if necessary):

docker run -v /tmp/helloworld:/src/main ponylang/ponyc

This will compile a main binary - but executing it directly in OS X will not work:

$ ./main 
-bash: ./main: cannot execute binary file

Instead, run it like this:

$ docker run -v /tmp/helloworld:/src/main ponylang/ponyc ./main
Hello, world!
@simonw

This comment has been minimized.

Owner

simonw commented Dec 18, 2017

See also the documentation for the container, which covers this exact issue: https://hub.docker.com/r/ponylang/ponyc/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment