docker image for openmamba buildvm

This project provides a Dockerfile and related files which can be easily used to create a Docker image and container set up with autodist and webbuild with the purpose to maintain and build openmamba RPM packages.

The project can be used on any O.S. with docker installed and supporting one of the following platforms:

  • linux/amd64 (x86_64)
  • linux/arm64 (aarch64)
  • linux/386 (i586)

Docker installation

When using openmamba as docker host you may first need to install it with:

sudo dnf install docker

Then it is recommended adding your user to the docker group (replace <username> with your username):

sudo usermod -aG docker <username>

Upon install you may need to start docker socket with:

sudo systemctl start docker.socket

Installation

Building the image is recommented via docker-buildx so you may first need to install it with:

sudo dnf install docker-buildx

Create buildvm image with:

docker buildx build -t buildvm --platform linux/amd64 .

Create and start a new container with:

docker run --name buildvm --hostname buildvm -d -p 4567:80 buildvm

A different name (replace any or all occurencies of buildvm in the two commands above) and local port mapping (replace 4567) may be used as needed.

x86 image on x86_64 host

Use the file Dockerfile-i586 to install a x86 image to be run on x86_64 host:

docker buildx build -t buildvm-i586 --platform linux/386 -f Dockerfile-i586 .

Container management

Stop with:

docker stop buildvm

Restart with:

docker start buildvm

Usage

Webbuild web interface

With a browser access the webbuild interface at:

http://localhost:4567

To access from another host you may replace localhost with the container host (remember to check that exposed port is open in firewall).

Login with the following credentials:

  • Username: autodist
  • Password: openmamba

Remote host and different port mapping may be used as needed.

Spawn a shell into the running container with:

docker exec -it --user root buildvm /bin/bash

Or as autodist user:

docker exec -it --user autodist buildvm /bin/bash

If using x86 container on x86_64 host commands need to be prefixed by linux32:

docker exec -it --user autodist buildvm-i586 linux32 /bin/bash

Configure container for automatic start and resource limits

Set the container for automatic start on Docker service restart or host reboot with the following command:

docker update --restart unless-stopped buildvm

You may limit the CPU and memory usage of the container with the following command:

docker update --cpuset-cpus="0-3" --cpus="4" --memory="8g" buildvm

Autoport cron job

autoport is specifically intented for openmamba maintainer to port packages to required architectures. The involved configuration is file:

/etc/sysconfig/autoport

Autoport needs to be globally enabled with setting:

AUTOPORT_ENABLE=1

Port configurations are defined in the same file inside array variables, in this example we use the first configuration with array index of 0:

AUTOPORT_ARCH[0]=aarch64
AUTOPORT_DISABLE[0]=
AUTOPORT_CHROOT_USER[0]=autodist
AUTOPORT_NATIVE[0]=1
AUTOPORT_REPOSITORIES[0]="devel-makedist devel-kernel devel-autodist devel-misc"
AUTOPORT_PORT_REPOSITORY[0]="#SELF"
AUTOPORT_BASE_REPOSITORY[0]="devel-autodist"
AUTOPORT_IMPORT_REPOSITORIES[0]="$AUTOPORT_DEVEL_IMPORT_REPOSITORIES"

The command to run autoport batch process for configuration with index 0 is:

docker exec -it buildvm /usr/bin/autoport-launcher 0

Maintainer wants to add autoport as a cron job. To do this you may set the cron job on the docker host by running crontab -e and adding the line:

0 * * * * docker exec buildvm /usr/bin/autoport-launcher 0 2>&1 | logger -t autoport0

You may see a resume of port processes by opening the page:

http://localhost:4567/autobuilds.html

Description
Docker image for openmamba buildvm
Readme 90 KiB
Languages
Dockerfile 92%
Shell 8%