A Docker container image for building and running Fifth language programs.
- Ubuntu 22.04 base image
- Fifth compiler tool from NuGet (
Fifth.Compiler.Toolv0.10.0) - Fifth MSBuild SDK from NuGet (
Fifth.Sdkv0.10.0) - .NET SDK 10.0
- Build tools:
gcc,git,curl
docker build --build-arg FIFTH_VERSION=0.10.0 --build-arg FIFTH_SDK_VERSION=0.10.0 -t fifth:0.10.0 .docker run --rm fifth:0.10.0 fifthc --version
docker run --rm -v "$(pwd):/workspace" fifth:0.10.0 sh -lc "dotnet tool restore && dotnet build src/Hello/Hello.5thproj"docker run --rm -it -v "$(pwd):/workspace" fifth:0.10.0 bashThis repository also publishes automatically via GitHub Actions when a tag is pushed in the format vX.Y.Z (or pre-release variants such as vX.Y.Z-rc.1). The published image tag strips the v prefix (for example, v0.10.0 publishes image tag 0.10.0) and uses the same version for FIFTH_VERSION and FIFTH_SDK_VERSION.
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a name (e.g.,
ghcr-fifth-push) - Select these scopes:
- ✅
write:packages - ✅
read:packages
- ✅
- Click Generate token and copy it immediately
# Replace YOUR_GITHUB_USERNAME and YOUR_PAT with your values
echo "YOUR_PAT" | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdinExample:
echo "ghp_xxxxxxxxxxxxxxxxxxxx" | docker login ghcr.io -u aabs --password-stdindocker build --build-arg FIFTH_VERSION=0.10.0 --build-arg FIFTH_SDK_VERSION=0.10.0 -t ghcr.io/aabs/fifthlang/fifth:0.10.0 .
docker tag ghcr.io/aabs/fifthlang/fifth:0.10.0 ghcr.io/aabs/fifthlang/fifth:latest
docker push ghcr.io/aabs/fifthlang/fifth:0.10.0
docker push ghcr.io/aabs/fifthlang/fifth:latestThis will:
- Build the image with the full registry name (
ghcr.io/aabs/fifthlang/fifth:0.10.0) - Push both the versioned tag and
latesttag to ghcr.io
Visit: https://github.com/aabs?tab=packages
Override defaults using Docker build args:
| Variable | Default | Description |
|---|---|---|
FIFTH_VERSION |
0.10.0 |
Fifth compiler tool version |
FIFTH_SDK_VERSION |
0.10.0 |
Fifth SDK version label |
Build with a different Fifth tool version:
docker build --build-arg FIFTH_VERSION=0.10.0 -t fifth:custom .Push to a different registry:
docker tag fifth:0.10.0 ghcr.io/myusername/fifth:0.10.0
docker push ghcr.io/myusername/fifth:0.10.0This repository includes the prerequisites used by the Fifth samples/FullProjectExample pattern:
global.jsonpinsFifth.Sdkto0.10.0.config/dotnet-tools.jsonpinsfifthc(Fifth.Compiler.Tool) to0.10.0nuget.configconfigures NuGet.org andFifth.*source mappingsrc/Hello/Hello.5thprojdemonstrates a minimal SDK-style Fifth project
docker pull ghcr.io/aabs/fifthlang/fifth:latestdocker run --rm -v "$(pwd):/workspace" ghcr.io/aabs/fifthlang/fifth:latest \
sh -lc "dotnet tool restore && dotnet build src/Hello/Hello.5thproj"docker run --rm -v "$(pwd):/workspace" ghcr.io/aabs/fifthlang/fifth:latest \
dotnet src/Hello/bin/Debug/net10.0/Hello.dllYou can use this image as the base for a VS Code DevContainer to get a complete Fifth development environment.
Create a .devcontainer folder in your project with a devcontainer.json file:
// .devcontainer/devcontainer.json
{
"name": "Fifth Development",
"image": "ghcr.io/aabs/fifthlang/fifth:latest",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csharp"
]
}
},
"postCreateCommand": "fifthc --version",
"remoteUser": "root"
}If you need additional tools, create .devcontainer/Dockerfile:
FROM ghcr.io/aabs/fifthlang/fifth:latest
# Add any additional tools you need
RUN apt-get update && apt-get install -y \
vim \
&& rm -rf /var/lib/apt/lists/*And reference it in devcontainer.json:
{
"name": "Fifth Development",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csharp"
]
}
}
}- Install the Dev Containers extension in VS Code
- Open your project folder
- Press
F1and select "Dev Containers: Reopen in Container"
VS Code will build/pull the container and open your project inside it with the Fifth compiler ready to use.
See the Fifth Language repository for license information.