Coder Social home page Coder Social logo

rotu / nimage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moigagoo/nimage

0.0 0.0 0.0 1.13 MB

Dockerfiles for various Nim versions published on Docker Hub

Home Page: https://hub.docker.com/repository/docker/nimlang/nim/

License: MIT License

Nim 91.87% Dockerfile 8.13%

nimage's Introduction

Welcome to Nim

Docker Pulls

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.

Tags

Tags indicate Nim versions, base images, and flavors. For example, nimlang/nim:0.16.0-ubuntu-regular means Nim version 0.16.0, based on Ubuntu, with Nimble installed. Ubuntu is the default base, so you can omit it in the tag: nimlang/nim:0.16.0-regular. Regular is the default flavor, so you can omit it as well: nimlang/nim:0.16.0. 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:0.16.0 = nimlang/nim:0.16.0-ubuntu =nimlang/nim:latest-ubuntu = nimlang/nim:0.16.0-regular = nimlang/nim:latest-regular = nimlang/nim:0.16.0-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, nimlang/nim:alpine, or nimlang/nim:onbuild.

Bases

There are currently two bases: Ubuntu and Alpine. Ubuntu is the default one.

Flavors

Images come in three flavors: slim, regular, and onbuild. Slim images include only the Nim compiler. Regular images include the compiler and Nimble package manager. Onbuild images are meant to be used in Dockerfiles for Nimble packages.

Using the Images

Get the Latest Version

$ docker pull nimlang/nim
$ docker pull nimlang/nim:devel

Compiling a Single File

$ docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim nim c -r myapp.nim

Compiling a Static Single File

$ docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim:alpine nim c --passL:"-static -no-pie" myapp.nim

Building a Nimble Package

Create a Dockerfile in the package root:

FROM nimlang/nim:onbuild
ENTRYPOINT ["./mycompiledbinary"]

Build your image and run the compiled binary:

$ docker build -t myapp .
$ docker run --rm myapp

nimage's People

Contributors

moigagoo avatar guitmz avatar nigredo-tori avatar ee7 avatar changhe3 avatar rotu avatar josh-papa avatar waghanza avatar gitter-badger avatar wezm avatar markprocess avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.