/at-docker

Holds dockerfiles and build script to create Docker images of the Advance Toolchain

Primary LanguageMakefileApache License 2.0Apache-2.0

About

The Dockerfiles distributed alongside this readme will produce Docker images that contain Advance Toolchain stack. Each image is composed of a bare minimum Linux distribution on which the Advance Toolchain is supported, and some extra development tools for C and C++. The Advance Toolchain provides a set of packages that will be installed according to the following profiles:

  • Runtime: the image comes with only runtime and mcore-libs (Multi-core libraries) packages, resulting in a image with smaller size.
  • Development: the image comes with development, performance, and runtime packages.

Requirements

If you are going to use the Makefile for builds, then the following commands should be installed in your host machine:

  • make
  • lsb_release
  • docker

Notice that the Linux user used to build Docker images should have permission to run the docker command. Check your Linux distribution documentation for more information on this topic.

Build

The configs directory contain a set of Dockerfiles to build images with different combinations of AT version (and packages), and a base Linux distribution. Thus, to ease the build process, use the make command as follows:

$ make

By default make builds an image with following configuration:

  • Latest AT version
  • Base image OS same of the host
  • Development profile

Some build parameters are available though, use following environment variables to set them:

  • AT_CONFIGSET=version, where version is the AT version (9.0, 10.0, and so on)
  • IMAGE_PROFILE=profile, where profile indicates a profile which may be either runtime or devel

The Makefile get the name of your host's OS to select a suitable image OS. Thus, you must use a Linux distribution to build the image on which we provide a Dockerfile for the same OS. You can check supported distribution in the directory configs/version/ for the given Advance Toolchain version.

Run

You can use docker run to create a container from AT images. For example, following command starts a container from AT 10.0 devel image and attach to a shell session:

docker run -it --privileged at/10.0:ubuntu_devel_ppc64le 

Important: some commands as gdb and ocount require access to host devices which are usually denied by default. This can be circumveted by granting privileged access to the container (see --privileged flag in above example), or allowing access to specfic devices. See Runtime privilege and Linux capabilities section at Docker Engine Reference for further details.