doc: move the "Building ACRN in Docker" user guide

Move the "Building ACRN in Docker" guide to the "Try using ACRN" section to be
more prominently visible. Reference it from the main "Build ACRN from Source"
user guide.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
Geoffroy Van Cutsem
2019-10-03 08:33:54 +02:00
committed by deb-intel
parent 1794d994b6
commit 6f7ba36ea0
5 changed files with 6 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
FROM clearlinux:latest
RUN swupd bundle-add os-clr-on-clr os-core-dev python3-basic
RUN pip3 install kconfiglib
WORKDIR /workspace

View File

@@ -52,7 +52,10 @@ Step 1: Install build tools and dependencies
********************************************
ACRN development is supported on popular Linux distributions, each with
their own way to install development tools:
their own way to install development tools. This user guide covers the different
steps to configure and build ACRN natively on your distribution. Please refer to
the :ref:`building-acrn-in-docker` user guide for instructions on how to build
ACRN using a container.
.. note::
ACRN uses ``menuconfig``, a python3 text-based user interface (TUI) for

View File

@@ -0,0 +1,156 @@
.. _building-acrn-in-docker:
Building ACRN in Docker
#######################
This tutorial shows how to build ACRN in a Clear Linux Docker image.
Install Docker
**************
#. Install Docker according to the `Docker installation instructions <https://docs.docker.com/install/>`_.
#. If you are behind an HTTP or HTTPS proxy server, follow the
`HTTP/HTTPS proxy instructions <https://docs.docker.com/config/daemon/systemd/#httphttps-proxy>`_
to set up an HTTP/HTTPS proxy to pull the Docker image and
`Configure Docker to use a proxy server <https://docs.docker.com/network/proxy/>`_
to set up an HTTP/HTTPS proxy for the Docker container.
#. Docker requires root privileges by default.
Follow these `additional steps <https://docs.docker.com/install/linux/linux-postinstall/>`_
to enable a non-root user.
.. note::
Performing these post-installation steps is not required. If you
choose not to, add `sudo` in front of every `docker` command in
this tutorial.
Get the Docker Image
********************
This tutorial presents two ways to get the Clear Linux Docker image that's needed to build ACRN.
Build the Docker Image from Dockerfile
======================================
#. Download `Dockerfile <https://raw.githubusercontent.com/projectacrn/acrn-hypervisor/master/doc/getting-started/Dockerfile>`_
to your development machine.
#. Build the Docker image:
.. code-block:: none
$ docker build -t clearlinux-acrn-builder:latest -f <path/to/Dockerfile> .
if you are behind an HTTP or HTTPS proxy server, use this command instead:
.. code-block:: none
$ docker build --build-arg HTTP_PROXY=http://<proxy_host>:<proxy_port> \
--build-arg HTTPS_PROXY=https://<proxy_host>:<proxy_port> \
-t clearlinux-acrn-builder:latest -f <path/to/Dockerfile> .
Get the Docker Image from Docker Hub
====================================
As an alternative, you can pull a pre-built Docker image from Docker Hub to your development machine. Use this command:
.. code-block:: none
$ docker pull acrn/clearlinux-acrn-builder:latest
Build ACRN from Source in Docker
********************************
#. Clone the acrn-hypervisor repo:
.. code-block:: none
$ mkdir -p ~/workspace && cd ~/workspace
$ git clone https://github.com/projectacrn/acrn-hypervisor
$ cd acrn-hypervisor
#. Build the acrn-hypervisor with the default configuration (Software Defined Cockpit [SDC] configuration):
For the Docker image build from Dockerfile, use this command to build ACRN:
.. code-block:: none
$ docker run -u`id -u`:`id -g` --rm -v $PWD:/workspace \
clearlinux-acrn-builder:latest bash -c "make clean && make"
For the Docker image downloaded from Docker Hub, use this command to build ACRN:
.. code-block:: none
$ docker run -u`id -u`:`id -g` --rm -v $PWD:/workspace \
acrn/clearlinux-acrn-builder:latest bash -c "make clean && make"
The build artifacts are found in the `build` directory.
Build the ACRN Service VM Kernel in Docker
******************************************
#. Clone the acrn-kernel repo:
.. code-block:: none
$ mkdir -p ~/workspace && cd ~/workspace
$ git clone https://github.com/projectacrn/acrn-kernel
$ cd acrn-kernel
#. Build the ACRN Service VM kernel:
For the Docker image built from Dockerfile, use this command to build ACRN:
.. code-block:: none
$ cp kernel_config_sos .config
$ docker run -u`id -u`:`id -g` --rm -v $PWD:/workspace \
clearlinux-acrn-builder:latest \
bash -c "make clean && make olddefconfig && make && make modules_install INSTALL_MOD_PATH=out/"
For the Docker image downloaded from Docker Hub, use this command to build ACRN:
.. code-block:: none
$ cp kernel_config_sos .config
$ docker run -u`id -u`:`id -g` --rm -v $PWD:/workspace \
acrn/clearlinux-acrn-builder:latest \
bash -c "make clean && make olddefconfig && make && make modules_install INSTALL_MOD_PATH=out/"
The commands build the bootable kernel image as ``arch/x86/boot/bzImage``,
and the loadable kernel modules under the ``./out/`` folder.
Build the ACRN User VM PREEMPT_RT Kernel in Docker
**************************************************
#. Clone the preempt-rt kernel repo:
.. code-block:: none
$ mkdir -p ~/workspace && cd ~/workspace
$ git clone -b 4.19/preempt-rt https://github.com/projectacrn/acrn-kernel preempt-rt
$ cd preempt-rt
#. Buildthe ACRN User VM PREEMPT_RT kernel:
For the Docker image built from Dockerfile, use this command to build ACRN:
.. code-block:: none
$ cp x86-64_defconfig .config
$ docker run -u`id -u`:`id -g` --rm -v $PWD:/workspace \
acrn/clearlinux-acrn-builder:latest \
bash -c "make clean && make olddefconfig && make && make modules_install INSTALL_MOD_PATH=out/"
For the Docker image downloaded from Docker Hub, use this command to build ACRN:
.. code-block:: none
$ cp x86-64_defconfig .config
$ docker run -u`id -u`:`id -g` --rm -v $PWD:/workspace \
acrn/clearlinux-acrn-builder:latest \
bash -c "make clean && make olddefconfig && make && make modules_install INSTALL_MOD_PATH=out/"
The commands build the bootable kernel image as ``arch/x86/boot/bzImage``,
and the loadable kernel modules under the ``./out/`` folder.