Skip to content

AdaCore/gnat-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker GNAT

The docker GNAT contains the Dockerfiles necessary to build a x86-64 Linux GNAT Pro docker image for use in CI or general dockerized context.

The repository has the following directories:

  • gnatpro-deps/ Dockerfile for a base image used to build the GNAT Pro toolsuite.
  • gnatpro/ Dockerfile for building a working compiler container, using a user-provided GNAT Pro release package.

In order to get a GNAT Pro release package, see GNAT Pro versions.

Requirements

  • You must have a recent version of Docker.
  • Scripts are developed and tested under a recent Linux distribution. Portability issues may arise for building the images under Windows or MacOS.

For the GNAT Pro image:

  • Put linux x86-64 GNAT Pro release in the gnatpro/ directory
  • Run the create_image script (see below)

Install

Known issue

You will probably have access rights error, add yourself to the docker group with sudo usermod -aG docker $USER then restart your session (this may require a full OS restart).

or else run with sudo sudo create_image

Performance Issues on macOS

You can experiment performance issues on macOS. This is due to the way Docker is designed, since Docker engine, on macOS and Windows, needs a Linux Kernel, so it runs Docker into a Virtual Machine.

In order to increase performance, notably for I/O disk, you have to use VirtioFS (Docker Desktop > Settings > General > Choose file sharing implementation for your containers). That way, bind mount performance will be increased. It is also recommended to use named volumes when it is possible.

Steps

With $gnat_release as the GNAT Pro .tar.gz release filem and $gnat_version as the GNAT Pro version number. Run ./create_image --gnat_version=$gnat_version $release_file NB: If you're unsure of the version number, let the argument empty for the script to infer it.

This will build two images

  • docker:deps for package dependencies and minimal tooling
  • docker:$gnat_version for compilation, eg docker:20.2.

You can then use the docker:$gnat_version image to spawn new containers for compilation.

Warning: Due to some docker limitations, the release file will be copied to the gnatpro/ dir. It can safely be removed at the end of build.

Quick check

Once you have created and tagged an image, you can check that GNAT is working properly by running a compilation of the examples.

docker run --entrypoint make -t gnat:$gnat_version -C /usr/gnat/share/examples/gnat RUN_DINERS=0

It should compile and run all the GNAT examples, and finish on a successful error code.

Open a shell on the image

docker run --entrypoint bash -it docker:$gnat_version will give you access to a console shell on the image.

You can then disconnect by either entering Ctrl+D or the exit command.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •