summaryrefslogtreecommitdiffstats
path: root/README-DOCKER.md
blob: ad2dd8e135b87e4a06757a5645a70a1bc1ce5132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Libabigail Docker

Libabigail comes with two Dockerfile in [docker](docker) to build each of:

 - a Fedora base image (recommended)
 - an Ubuntu base image.

These containers are built and deployed on merges to the main branch and releases.

### Usage

Here is how to build the containers. Note that we build so it belongs to the same
namespace as the repository here. "ghcr.io" means "GitHub Container Registry" and
is the [GitHub packages](https://github.com/features/packages) registry that supports
 Docker images and other OCI artifacts.

```bash
$ docker build -f docker/Dockerfile.fedora -t ghcr.io/woodard/libabigail-fedora .
```
```bash
$ docker build -f docker/Dockerfile.ubuntu -t ghcr.io/woodard/libabigail-ubuntu-22.04 .
```

Note that currently the fedora image is deployed to `ghcr.io/woodard/libabigail:latest`.

### Shell

To shell into a container (here is an example with ubuntu):

```bash
$ docker run -it ghcr.io/woodard/libabigail-ubuntu-22.04 bash
```

Off the bat, you can find the abi executables:

```bash
# which abidiff
/opt/abigail-env/.spack-env/view/bin/abidiff
```

Since the ubuntu base uses spack, you can interact with spack.
You can go to the environment in `/opt/abigail-env` and (given you
have the source code bound to `/src`) build and test again.

```bash
$ spack install
```

And that's it! This workflow should make it easy to install development versions of libabigail with spack.
We will also use the "production" containers to grab libraries in:

```
$ ls /opt/abigail-env/.spack-env/view/
bin  include  lib  share
```

Note that the fedora container does not come with spack.

### Testing

We provide a testing container, which will use a fedora base and add new code to
compile, and then run `make check`. You can do this as follows on your local machine:

```bash
$ docker build -f docker/Dockerfile.test -t test .
```