Skip to content

chrisheller/docker-nim-cross

 
 

Repository files navigation

Overview

Dockerfile for Nim cross-compiler

packages

Usage

Example compilation

echo 'echo "Hello World"' > hello.nim
docker run --rm -v `pwd`:/usr/local/src \
   chrishellerappsian/docker-nim-cross:latest \
   nim c --os:windows --cpu:amd64 --out:hello64.exe hello.nim

docker run --rm -v `pwd`:/usr/local/src \
    chrishellerappsian/docker-nim-cross:latest \
    nim c --os:macosx --cpu:amd64 --out:hello32.osx.bin hello.nim

Look at example directory.

Adding libraries

See the example/libssh directory for an example of adding an updated library to the build process.

The example brings libssh2 up to date so that the Nim ba0f3/ssh2 module can be built and tested.

See the test scripts test_sftp and test_scp for verifying sftp and scp work properly from within your Nim code. Each shell script should work unmodified to access the public Rebex test server

Directories in container

  • /usr/local/src/: working dir
  • /usr/bin/x86_64-w64-mingw32-gcc: compiler for 64 bit Windows
  • /usr/bin/i686-w64-mingw32-gcc: compiler for 32 bit Windows
  • /opt/osxcross/target/bin/o64-clang: compiler for 64 bit MacOSX
  • /opt/osxcross/target/bin/o32-clang: compiler for 32 bit MacOSX
  • /usr/bin/musl-gcc: compiler for Linux(musl)

default command

default command is bash.

About

Dockerfile for Nim lang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 51.7%
  • Nim 39.7%
  • Shell 8.6%