Skip to content

Instantly share code, notes, and snippets.

@simonw
Created December 18, 2017 21:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save simonw/52f2128e3bafe1bc8dcde7622fe6f359 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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