|
| 1 | +# ELBE development container |
| 2 | + |
| 3 | +[//]: # "Copyright (c) 2021 Daniel Braunwarth <[email protected]>" |
| 4 | +[//]: # "SPDX-License-Identifier: GPL-3.0-or-later" |
| 5 | + |
| 6 | +This container is intended to build and run ELBE from Git sources. |
| 7 | + |
| 8 | +To build and run the container [Podman](https://podman.io/) should be used. |
| 9 | + |
| 10 | +The container is based on the official Debian Bullseye image in the slim |
| 11 | +variant. |
| 12 | + |
| 13 | +## Dependencies |
| 14 | + |
| 15 | +To be able to build and use this container you need: |
| 16 | + |
| 17 | +- [Make](https://www.gnu.org/software/make/) |
| 18 | +- [Podman](https://podman.io/) |
| 19 | + |
| 20 | + See <https://podman.io/getting-started/> for information how to get started |
| 21 | + with Podman. |
| 22 | + |
| 23 | +## Security |
| 24 | + |
| 25 | +Unfortunately podman cannot be used in rootless mode, because ELBE needs the |
| 26 | +`CAP_SYS_ADMIN` capability to be able to facilitate QEMU. |
| 27 | + |
| 28 | +At the moment the container is started in privileged mode. This should be |
| 29 | +restricted in the future. |
| 30 | + |
| 31 | +## Usage |
| 32 | + |
| 33 | +### Build container image |
| 34 | + |
| 35 | +To build the container image run: |
| 36 | + |
| 37 | +```shell |
| 38 | +sudo make build |
| 39 | +``` |
| 40 | + |
| 41 | +The resulting image is named `elbe-devel`. |
| 42 | + |
| 43 | +### Start container |
| 44 | + |
| 45 | +To start the container run: |
| 46 | + |
| 47 | +```shell |
| 48 | +sudo make start |
| 49 | +``` |
| 50 | + |
| 51 | +The started container is named `elbe-devel`. It is not possible to start |
| 52 | +multiple container instances. |
| 53 | + |
| 54 | +### Stop container |
| 55 | + |
| 56 | +To stop the container run: |
| 57 | + |
| 58 | +```shell |
| 59 | +sudo make stop |
| 60 | +``` |
| 61 | + |
| 62 | +### Attach to running container |
| 63 | + |
| 64 | +To attach to a running container run: |
| 65 | + |
| 66 | +```shell |
| 67 | +sudo make attach |
| 68 | +``` |
| 69 | + |
| 70 | +The default working directory is `/usr/src`. This is where the Git repository |
| 71 | +is mounted to. |
| 72 | + |
| 73 | +### Build initvm |
| 74 | + |
| 75 | +To build an initvm attach to the running container and run: |
| 76 | + |
| 77 | +```shell |
| 78 | +./elbe initvm --devel create elbepack/init/initvm-ssh-root-open-danger.xml |
| 79 | +``` |
| 80 | + |
| 81 | +To be able to sync the ELBE sources between the Git repository and the initvm |
| 82 | +we must be able to connect to the initvm via SSH as root user. For this reason |
| 83 | +we are using `elbepack/init/initvm-ssh-root-open-danger.xml`. |
| 84 | + |
| 85 | +### Add already existing initvm to container |
| 86 | + |
| 87 | +To add an already existing initvm to a newly created container instance attach |
| 88 | +to the running container and run: |
| 89 | + |
| 90 | +```shell |
| 91 | +virsh --connect qemu:///system define initvm/libvirt.xml |
| 92 | +``` |
| 93 | + |
| 94 | +### Update ELBE in initvm |
| 95 | + |
| 96 | +To update the used ELBE sources in an initvm run: |
| 97 | + |
| 98 | +```shell |
| 99 | +./elbe initvm --devel sync |
| 100 | +``` |
| 101 | + |
| 102 | +### Clean-up |
| 103 | + |
| 104 | +To remove the container instance and image run: |
| 105 | + |
| 106 | +```shell |
| 107 | +sudo make clean |
| 108 | +``` |
0 commit comments