From 0677e92141b8b78553b9f1e282eb69dd1af285ac Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 21 May 2016 01:39:19 -0400 Subject: [PATCH] docker: add a README Signed-off-by: Jean Privat --- misc/docker/README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 misc/docker/README.md diff --git a/misc/docker/README.md b/misc/docker/README.md new file mode 100644 index 0000000..d255285 --- /dev/null +++ b/misc/docker/README.md @@ -0,0 +1,64 @@ +# Supported tags and respective Dockerfile links + +* [latest](https://github.com/nitlang/nit/blob/master/misc/docker/Dockerfile) +* [full](https://github.com/nitlang/nit/blob/master/misc/docker/full/Dockerfile) + +## What is Nit? + +Nit is an expressive language with a script-like syntax, a friendly type-system and aims at elegance, simplicity and intuitiveness. + +Nit has a simple straightforward style and can usually be picked up quickly, particularly by anyone who has programmed before. +While object-oriented, it allows procedural styles. + +More information on + +* Website +* Github +* Chatroom + +## How to use this image + +You can use these images to build then run your programs. + +### Experimenting with Nit + +~~~ +host$ docker run -ti nitlang/nit +root@ce9b671dd9fc:/root/nit# nitc examples/hello_world.nit +root@ce9b671dd9fc:/root/nit# ./hello_world +hello world +~~~ + +### Build and Run Programs + +In your Dockerfile, write something like: + +~~~Dockerfile +FROM nitlang/nit + +# Create a workdir +RUN mkdir -p /root/work +WORKDIR /root/work + +# Copy the source code in /root/work/ +COPY . /root/work/ + +# Compile +RUN nitc src/hello.nit --dir . \ + # Clear disk space + && ccache -C +# You can also use a Makefile or any build system you want. + +# Run +CMD ["./hello"] +~~~ + +Then, build and execute + +~~~ +host$ docker build -t nithello . +host$ docker run --rm nithello +hello! +~~~ + +See the full example at -- 1.7.9.5