All Projects → sirredbeard → nim-windows-container

sirredbeard / nim-windows-container

Licence: Apache-2.0 license
Windows Container for building Nim applications

Programming Languages

Dockerfile
14818 projects

Untitled3

Nim Windows Container

This repository contains:

  • A Dockerfile that builds a Windows Server Core Container with Nim and Mingw-w64 dependencies as a starting point for building Nim applications in Windows Containers.
  • A GitHub Actions workflow for deploying the Windows Container to the GitHub Container Registry.

Nim

Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance.

Dockerfile

The sample Dockerfile defaults to:

  • Windows Server 2022 LTSC.
  • Nim 1.4.8, the current stable release of Nim. It is very likely by the time you are reading this that Nim has since been updated. Check nim-lang releases for the latest release.

GitHub Actions Workflow

This sample GitHub Actions workflow:

  • Builds the Windows Container for both Windows Server 2019 LTSC and Windows Server 2022 LTSC. The default of Windows Server 2022 LTSC is overridden for 2019 LTSC builds by passing --build-arg win_version=ltsc2019 into the Dockerfile.
  • Detects and downloads the latest version of Nim by communicating with the GitHub REST API: $nim_version = ((Invoke-RestMethod -Uri https://api.github.com/repos/nim-lang/Nim/tags).Name | Select-Object -first 1).Trim("v") and passing the most recent version into the Dockerfile as a build argument: --build-arg nim_version=$nim_version, overriding the default of 1.4.8.
  • Pushes the resulting container to the GitHub Container Registry.

It is not currently possible to run Windows Containers on GitHub Actions at this time, the runner only supports Linux containers. :(

Windows Container

To use my builds:

Windows Server 2019

docker pull ghcr.io/sirredbeard/nim-windows-container/nimstable-ltsc2019:latest

GitHub Container Registry page.

Windows Server 2022

docker pull ghcr.io/sirredbeard/nim-windows-container/nimstable-ltsc2022:latest

GitHub Container Registry page.

Build Yourself

To build and use the Windows Container yourself, you can use the Dockerfile, or:

image

  • Run
Set-Variable -Name "CR_PAT" -Value "<PAT>"
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
docker pull ghcr.io/<USERNAME>/nim-windows-container/nimstable-ltsc2019:latest``
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].