https://github.com/nim-lang/docker-images
Official Docker Hub images for Nim programming language
https://github.com/nim-lang/docker-images
docker dockerfile nim nim-lang
Last synced: 13 days ago
JSON representation
Official Docker Hub images for Nim programming language
- Host: GitHub
- URL: https://github.com/nim-lang/docker-images
- Owner: nim-lang
- License: mit
- Created: 2016-07-31T11:07:22.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-08T19:22:53.000Z (14 days ago)
- Last Synced: 2025-04-08T19:43:49.357Z (14 days ago)
- Topics: docker, dockerfile, nim, nim-lang
- Language: Nim
- Homepage: https://hub.docker.com/r/nimlang/nim
- Size: 1.15 MB
- Stars: 74
- Watchers: 8
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to
Nim

Nim is a statically typed, imperative programming language that tries to give the programmer ultimate power without compromises on runtime efficiency. This means it focuses on compile-time mechanisms in all their various forms.
Beneath a nice infix/indentation based syntax with a powerful (AST based, hygienic) macro system lies a semantic model that supports a soft realtime GC on thread local heaps. Asynchronous message passing is used between threads,
so no "stop the world" mechanism is necessary. An unsafe shared memory heap is also provided for the increased efficiency that results from that model.- [Official site](http://nim-lang.org)
- [Tutorials](http://nim-lang.org/learn.html)
- [Documentation](http://nim-lang.org/documentation.html)
- [Report an issue with images](https://github.com/nim-lang/docker-images/issues/new)# Tags
Tags indicate Nim versions, base images, and flavors. For example, `nimlang/nim:2.2.2-ubuntu-regular` means Nim version 2.2.2, based on Ubuntu, with Nimble installed. Ubuntu is the default base, so you can omit it in the tag: `nimlang/nim:2.2.2-regular`. Regular is the default flavor, so you can omit it as well: `nimlang/nim:2.2.2`. The latest Nim version is additionally tagged as `latest`: `nimlang/nim:latest`. And since Docker adds `latest` automatically, you can just write `nimlang/nim`.
So, all together:
nimlang/nim = nimlang/nim:latest = nimlang/nim:2.2.2 = nimlang/nim:2.2.2-ubuntu =nimlang/nim:latest-ubuntu = nimlang/nim:2.2.2-regular = nimlang/nim:latest-regular = nimlang/nim:2.2.2-ubuntu-regular = nimlang/nim:latest-ubuntu-regular
Phew, that's one long list! Fortunately, unless you need a specific version of Nim, you'll probably need just `nimlang/nim` or `nimlang/nim:alpine`.
Should you want to install a devel branch of the nim compiler or manage multiple nim version we have a `nimlang/choosenim` image, which provides `choosenim`. `choosenim` is a tool designed for managing your nim installation, read more [here](https://github.com/nim-lang/choosenim).
## Bases
There are currently two bases for `nimlang/nim` images: Ubuntu and Alpine. Ubuntu is the default one.
The `nimlang/choosenim` image is based on bitnami/minideb.
## Flavors
`nimlang/nim` images come in two flavors: *slim* and *regular*. Slim images include only the Nim compiler. Regular images include the compiler and [Nimble](https://github.com/nim-lang/nimble) package manager.
# Using the Images
## Get the Latest Version
```shell
$ docker pull nimlang/nim
``````shell
$ docker pull nimlang/choosenim
```## Compiling a Single File
```shell
$ docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim nim c -r myapp.nim
```## Compiling a *Static* Single File
```shell
$ docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim:alpine nim c --passL:"-static -no-pie" myapp.nim
```