Dev-container-ada: Professional Ada Dev Container

What is it?

The dev-container-ada project provides a reproducible Ada development environment that automatically adapts to the host user at runtime. You no longer need to install and configure development tools on each machine!

Project

Please review the README.md and USER_GUIDE.md documentation.

OR ==> Quick Start: As easy as 1..2..3!

1: PULL: docker pull ghcr.io/abitofhelp/dev-container-ada:latest
2: CD TO SOURCE MOUNT: cd /ada/github.com/abitofhelp
3: RUN DEV CONTAINER:

docker run -it --rm \
  -e HOST_UID=$(id -u) \
  -e HOST_GID=$(id -g) \
  -e HOST_USER=$(whoami) \
  -v "/ada/github.com/abitofhelp":/workspace \
  -w /workspace \
  ghcr.io/abitofhelp/dev-container-ada:latest

Use the terminal to work with your project, as usual.

Features

  • INTEGRATES WITH IDE’S LIKE VSCODE, JETBRAINS, GNATSTUDIO!
  • Ubuntu 24.04
  • Alire package manager
  • GNAT Ada compiler
  • GPRBuild
  • Python 3 + venv
  • Zsh interactive shell
  • Runtime-adaptive user identity (no rebuild needed per developer)
  • Container-aware shell prompt
  • Designed for nerdctl + containerd (rootless)
  • Also works with Docker (rootful), Podman (rootless), and Kubernetes
  • GitHub Actions for build verification and container publishing
  • Makefile for common build and run targets
7 Likes

Using Ubuntu 24 is incorrect here if you want it to work with compilers from Alire, which are built on Ubuntu 22. GNAT builds are tied to a specific glibc version by the contents of s-oscons.ads and using them with other versions will lead to erroneous behaviour of compiled programs.

If you want to use Ubuntu 24 then use the GNAT package from Ubuntu. If you want to use Alire GNAT builds then use Ubuntu 22.

1 Like

Currently the only difference between the latest glibc and the one on Ubuntu 22 is baud rate definitions, but this could change at any time. It is not worth playing with fire by using a different version.

41c41
< --  This is the version for x86_64-suse-linux (from OpenSUSE Tumbleweed)
---
> --  This is the version for x86_64-pc-linux-gnu (from Alire)
59c59
<    Target_Name                   : constant String  := "x86_64-suse-linux";
---
>    Target_Name                   : constant String  := "x86_64-pc-linux-gnu";
176,205c176,205
<    B50                           : constant := 50;         --  50 bps
<    ...
<    B4000000                      : constant := 4000000;    --  4000000 bps
---
>    B50                           : constant := 1;          --  50 bps
>    ...
>    B4000000                      : constant := 4111;       --  4000000 bps

Thanks for the heads-up! I’ve redesigned the project to provide two specific containers…

=============================================
dev_container_ada v2.0.1 — Two Ready-to-use Ada development containers:

  1. Package dev-container-ada · GitHub — Ubuntu 22.04 with Alire 2.1.0, GNAT 15.2.1, and GPRBuild 25.0.1. The full Alire-managed toolchain gives you access to the Ada/SPARK ecosystem and its package index out of the box.

  2. Package dev-container-ada-system · GitHub — Ubuntu 24.04 with system-packaged GNAT 13 and GPRBuild. A lighter alternative when you need a stable, distro-supported compiler without Alire’s downloaded toolchains.

Both images include Zsh with autosuggestions and syntax highlighting, Python 3 with venv support, and a runtime-adaptive entrypoint that maps your host UID/GID into the container — no rebuild needed per developer.

They work with Docker, nerdctl, and Podman across macOS and Linux.

GitHub: GitHub - abitofhelp/dev_container_ada: Professional Ada development container using Alire, GNAT, and GPRBuild. · GitHub

4 Likes

Love it, thanks for sharing! It built one of my Alire projects flawlessly.

I had done something similar here: Mark Hermeling / Alire-SDK · GitLab, which I then use in pipelines as well as in devcontainers.

Awesome, Mark!

FYI: I’ve created a similar dev container for c/cpp and will release it to my github later today. I plan to make one more project for Rust, too.

I’ve created a similar development container for C/C++ desktop and embedded platforms. It is at GitHub - abitofhelp/dev_container_cpp: Professional C++ development container for desktop and embedded (ARM Cortex-M) development · GitHub.

I will announce another project for Rust in the near future.

I am happy to announce that I have completed the dev_container_rust project. It is at GitHub - abitofhelp/dev_container_rust: Professional Rust development container for desktop and embedded (ARM Cortex-M/A) development · GitHub.

You also have the option of just running the Alire GCC build script yourself on your target distro. It’s located here: GitHub - alire-project/GNAT-FSF-builds: Builds of the GNAT Ada compiler from FSF GCC releases · GitHub

This is a neat project! I immediately tried creating a Distrobox from the image:

distrobox create -i ghcr.io/abitofhelp/dev-container-ada:latest -n ada_dev

Despite an initial user creation error, it works nicely. I was able to step right into one of my projects and do an alr clean && alr build.

1 Like

Distrobox is really cool, too! I need to experiment with it when I get a break in my current dev action. :slight_smile: Thank you for letting me know how easy it was to use in your project! :slight_smile:

1 Like

I am happy to announce that I have completed the dev_container_go project. Admittedly, not a primary interest here, but I wanted to make its existance known.