1# Libabigail Docker 2 3Libabigail comes with two Dockerfile in [docker](docker) to build each of: 4 5 - a Fedora base image (recommended) 6 - an Ubuntu base image. 7 8These containers are built and deployed on merges to the main branch and releases. 9 10### Usage 11 12Here is how to build the containers. Note that we build so it belongs to the same 13namespace as the repository here. "ghcr.io" means "GitHub Container Registry" and 14is the [GitHub packages](https://github.com/features/packages) registry that supports 15 Docker images and other OCI artifacts. 16 17```bash 18$ docker build -f docker/Dockerfile.fedora -t ghcr.io/woodard/libabigail-fedora . 19``` 20```bash 21$ docker build -f docker/Dockerfile.ubuntu -t ghcr.io/woodard/libabigail-ubuntu-22.04 . 22``` 23 24Note that currently the fedora image is deployed to `ghcr.io/woodard/libabigail:latest`. 25 26### Shell 27 28To shell into a container (here is an example with ubuntu): 29 30```bash 31$ docker run -it ghcr.io/woodard/libabigail-ubuntu-22.04 bash 32``` 33 34Off the bat, you can find the abi executables: 35 36```bash 37# which abidiff 38/opt/abigail-env/.spack-env/view/bin/abidiff 39``` 40 41Since the ubuntu base uses spack, you can interact with spack. 42You can go to the environment in `/opt/abigail-env` and (given you 43have the source code bound to `/src`) build and test again. 44 45```bash 46$ spack install 47``` 48 49And that's it! This workflow should make it easy to install development versions of libabigail with spack. 50We will also use the "production" containers to grab libraries in: 51 52``` 53$ ls /opt/abigail-env/.spack-env/view/ 54bin include lib share 55``` 56 57Note that the fedora container does not come with spack. 58 59### Testing 60 61We provide a testing container, which will use a fedora base and add new code to 62compile, and then run `make check`. You can do this as follows on your local machine: 63 64```bash 65$ docker build -f docker/Dockerfile.test -t test . 66``` 67