firmware-open icon indicating copy to clipboard operation
firmware-open copied to clipboard

Add Containerfile for development

Open crawfxrd opened this issue 2 years ago • 2 comments

Add a command to create a Debian-based container with the coreboot, SDCC, and Rust toolchains installed in order to minimize the workspace setup time and ensure build environments are the same.

make -C containers
podman run -it --rm \
    -v $PWD:/workspace:Z \
    -v ~/.ccache:/root/.cache/ccache:Z \
    system76/firmware-open:latest \
    ./scripts/build.sh oryp8

A locally built image is 2.46 GiB.

Ref: https://github.com/system76/firmware-open/issues/463

TODO (later)

  • Versioning for the container?
  • Build from CI and publish somewhere? (publish to/pull from ghcr.io or Docker Hub)
  • Simplify using it for local development? (don't require typing the full podman command)
    • Default to using the container, and have an override to build on the host
  • Get Jenkins to use it?

crawfxrd avatar Oct 17 '23 02:10 crawfxrd

I get an error due to not having a ~/.ccache directory. What do I need to do to remedy that?

XV-02 avatar Jul 19 '24 17:07 XV-02

Host will still need ccache installed, and it seems to be ~/.cache/ccache on Debian (ccache -p | grep cache_dir).

So the example probably needs to be:

-     -v ~/.ccache:/root/.ccache:Z \
+     -v ~/.cache/ccache:/root/.cache/ccache:Z \

crawfxrd avatar Jul 19 '24 18:07 crawfxrd