• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

rustup/14-Jan-2024-868665

DockerfileD15-Dec-20242.3 KiB8274

README.mdD15-Dec-20242.2 KiB6850

build-in-container.pyD14-Jan-20248.5 KiB212146

container-build-image.pyD15-Dec-20246.2 KiB15998

llvm-rename.shD14-Jan-20244.3 KiB5847

README.md

1# Container build for Floss
2
3This repo contains the Container-image build rule, used to generate the
4(docker/podman) container image necessary to build Floss. If building a new
5docker/podman image, run `container-build-image.py` with the tag `floss:latest`.
6
7## Container binary: setting up podman (default)
8
9On most Debian based machines, you should be able to simply use `apt-get` and
10install these requisite packages.
11```
12sudo apt-get install \
13  podman \
14  uidmap
15```
16
17Then, we need to set up podman for [rootless
18mode](https://docs.podman.io/en/latest/markdown/podman.1.html#rootless-mode):
19```
20sudo usermod --add-subuids 10000-75535 USERNAME
21sudo usermod --add-subgids 10000-75535 USERNAME
22```
23
24## Container binary: setting up docker (alternative)
25
26Follow the installation instructions at:
27https://docs.docker.com/engine/install/, such as
28https://docs.docker.com/engine/install/debian/.
29
30Also consider configuring Docker to run in rootless mode:
31https://docs.docker.com/engine/security/rootless/
32
33## Generating the floss-build image
34
35Run the following to generate the required image:
36```
37container-build-image.py --tag floss:latest
38```
39
40If you use the `docker` binary, add the flag: `--use-docker` when running
41`container-build-image.py`.
42
43This uses the default tag of `floss:latest` so you don't have to provide it
44specifically when invoking `build-in-container.py`.
45
46## Using the container image to build
47
48Once the container image is built (and assuming it's tagged as `floss:latest`), you
49should use the `build-in-container.py` script to build the current repo.
50
51Basic build:
52```
53build-in-container.py
54```
55
56This script will use the local `floss:latest` (or pull it from the registry),
57mount (or create) the `floss-out` volume to `/root/.floss` and the current
58source to `/root/src` before running these commands in the container:
59
60* `cd /root/src`
61* `./build.py --run-bootstrap`
62* `./build.py --libdir=/usr/lib/x86-64_linux_gnu/`
63
64If you want to run the build more quickly (or pass other commands), run
65`build-in-container.py --only-start`. This will only start the container for you
66(doing the correct mounts) and will print the commands it would have run via
67`<container_binary> exec` normally.
68