diff options
author | 2017-05-11 01:06:09 +0200 | |
---|---|---|
committer | 2017-05-11 01:06:09 +0200 | |
commit | a7bf03217af780f4245af555efdbfdc7ca9e2935 (patch) | |
tree | 66698dc80d43d3ff023560bc483acf66a964212d /README.md | |
parent | f32036a025d8ae7e6ef02aca8b080e5bca60fc11 (diff) |
Introduce flavours for containers
Multiple variations over a common base must be supported when creating AGL containers.
This commit introduces 'flavours' to achive this goal (see README.md for details).
Current supported flavours:
* generic : same image as before
* xds : new image dedicated to AGL DevKit
Change-Id: I0aa65a1d9e83a2d7aed43e0b135dc43c5537bc53
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -29,19 +29,35 @@ Typically, the sequence to build an image is: # make clean ``` +By default, the flavour 'generic' is used: the resulting container has multiple capabilities +(platform build, sdk build, documentation compiling etc.) at the cost of size. + +To change the flavour, specify FLAVOUR=your_flavour on the command line. For example: + +``` +# make build FLAVOUR=xds +... +# make export FLAVOUR=xds +... +# make clean FLAVOUR=xds +``` + ## How it works The Dockerfile is generic: it simply inherits from a Debian image. -When running a 'docker build': +When running a 'make build': +* the Makefile creates a temp file INSTALL/flavour.conf to record the selected flavour * Docker instantiates a new container based on the latest Debian image * Docker copies the INSTALL folder inside the container in /root/INSTALL -* then it runs the setup script /root/INSTALL/docker/setup_image.sh +* then it runs the setup script /root/INSTALL/setup_image.sh In turn, this setup script will: -* source the configuration file /root/INSTALL/docker/image.conf -* execute all scripts contained in /root/INSTALL/setup.d +* source the configuration file /root/INSTALL/image.conf +* source the flavour file /root/INSTALL/flavour.conf +* execute all scripts contained in /root/INSTALL/common.d +* execute all scripts located in /root/INSTALL/tasks.d and referenced from INSTALL/flavours/$FLAVOUR.tasks When the setup script finishes, Docker commits the temporary container in a new image. @@ -63,12 +79,14 @@ In the second case, the efficiency is better but requires to transfer the image ### Instantiate a container -The following command can be used as an example to instantiate a container: +The following command located in contrib/ subdir can be used as **an example** to instantiate a container: ``` -# ./create_container 0 +# contrib/create_container 0 ``` To instantiate more containers on the same host, the instance ID passed as argument must be different from the previous ones. +**PLEASE ADJUST THE SCRIPT create_container TO FIT YOUR ENVIRONMENT AND YOUR NEEDS** + |