acrn-hypervisor/hypervisor/.travis-dockerfiles
Geoffroy Van Cutsem 1ac5a2aebd Enable Travis CI for all combinations
Enable the Travis CI testing for all combinations of variables
that can be set at compile-time. I.e. RELEASE={0|1} and
PLATFORM={0|1}

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-05-15 17:25:24 +08:00
..
Dockerfile.centos7 Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
Dockerfile.clearlinux Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
Dockerfile.debian8 Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
Dockerfile.fedora26 Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
Dockerfile.fedora27 Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
Dockerfile.ubuntu14.04 Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
Dockerfile.ubuntu16.04 Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
LICENSE Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
README.md Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00
test_all_distros.sh Enable Travis CI for all combinations 2018-05-15 17:25:24 +08:00

README.md

Build containers for Project ACRN

Introduction

This repository contains a number of Dockerfile that include all the build tools and dependencies to build the ACRN Project components, i.e. the acrn-hypervisor and acrn-devicemodel

The workflow is pretty simple and can be summarized in these few steps:

  1. Build the build containers based on your preferred OS
  2. Clone the Project ACRN repositories
  3. Start the build container and give it the repositories
  4. Build the Project ACRN components

The pre-requisite is that you have Docker installed on your machine. Explaining how to install it on your system is beyond the scope of this document, please visit https://www.docker.com for detailed instructions.

Build the build containers

Each Dockerfile in this repo has an extension that tells what Linux distribution it is based on. To build a container using any of those, use this command:

$ sudo docker build -t <container-name> -f Dockerfile.<baseos> .

As an example, to build a container based on CentOS 7, do:

$ sudo docker build -t centos7 -f Dockerfile.centos7 .

Clone Project ACRN

Follow these simple steps to clone the Project ACRN repositories

$ mkdir ~/acrn
$ cd ~/acrn
$ git clone https://github.com/projectacrn/acrn-hypervisor
$ git clone https://github.com/projectacrn/acrn-devicemodel

Start the build container

Use this ~/acrn folder and pass it on to your build container:

$ cd ~/acrn
$ sudo docker run -ti -v $PWD:/root/acrn <container-name>

Using CentOS 7 again as an example, that gives us:

$ cd ~/acrn
$ sudo docker run -ti -v $PWD:/root/acrn centos7

Note: if you encounter permission issues within the container (as it happens on a Fedora 27 host), try adding the :z parameter to the mount option. This will unlock the permission restriction (that comes from SElinux). Your command-line would then be:

$ cd ~/acrn
$ sudo docker run -ti -v $PWD:/root/acrn:z centos7

Build the ACRN components

The steps above place you inside the container and give you access to the Project ACRN repositories you cloned earlier. You can now build any of the components. Here is an example:

# cd acrn-hypervisor
# make PLATFORM=uefi RELEASE=1

You can do this for all build combinations and also try to build the acrn-devicemodel. All the build dependencies and tools are pre-installed in the container as well as a couple of useful tools (git and vim) so you can directly edit files to experiment from within the container.