Nim compiler in Docker images, but with support for multiple platforms.
The current official Nimage only supports linux/amd64
builds.
This one supports at least the following platforms, based on what the Ubuntu base images support.
linux/ppc64le
linux/arm/v7
linux/arm64/v8
linux/amd64
The Alpine based images support the following architectures.
linux/ppc64le
linux/arm/v7
linux/arm64/v8
linux/amd64
Semver tags are referring to the Nim version contained in that particular image.
docker pull akito13/nim
docker pull akito13/nim:2.0.8
Tags follow semver, without the v
.
Git tags equal Docker tags, so no need to check tags explicitly on Docker Hub.
bash docker-build.sh
echo 'import std/json; echo """{"hello":"test"}""".parseJson.pretty' > t.nim
If you simply need to compile something, always use the rootless image.
docker run -itv "$PWD:/cwd" --rm akito13/nim:2.0.8-rootless bash -c "nim c -r /cwd/t.nim && rm /cwd/t"
If you compile or install something, which depends on libraries installed through apt
or otherwise need root access, you can use the root
based image.
docker run -it --rm akito13/nim:2.0.8 bash -c "apt update && apt install -y libncurses-dev && nimble install -y moe"
You may also run the rootless image as root
, if you don't want to download an additional image & instead re-use the already existing rootless one.
docker run -it --rm --user root akito13/nim:2.0.8-rootless bash -c "apt update && apt install -y libncurses-dev && nimble install -y moe"
You may also use the Alpine based images.
docker run -it --rm akito13/nim:2.0.8-alpine sh -c "apk --no-cache add ncurses-dev pcre && nimble install -y moe"
Copyright © 2022-2024 Akito [email protected]
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.