Can I create a Docker image to "cache" the yocto / bitbake assembly?

I am creating a Yocto image for a project, but this is a long process. On my powerful dev machine, it takes about 3 hours and can consume up to 100 GB of space.

The fact is that the final image is not a “mandatory” ultimate goal; this is my application that runs on top of it, which is important. So yocto recipes don't change much, but my application does.

I would like to use continuous integration (CI) for my application and even continuous delivery (CD). But both are rather complicated due to the yocto build size.

Since the build has not changed much, I somehow "cache" it and use it for my CI / CD application, and I, although from Docker. This would be very interesting, since I could save this image and share it with my colleagues, who should work on the project and use it in CI / CD.

  • Can a custom Docker image be created for this use?
  • Is it possible to create such an image completely offline? I don’t want to download 100 GB and reboot it on build machines ...

Thank!

+4
source share
1 answer

1. Yes.

I used docker to create Yocto images for many reasons, always with positive results.

2. Yes, with some work.

, Yocto , , , " ". ${BUILDDIR}/sstate-cache, , . .

1 sstate mirror:

, , .

local.conf:

SSTATE_MIRRORS ?= "\
file://.* http://my.shared-computer.com/some-folder/PATH"

. . .

2 sstate-cache .

docker sstate-cache ( , /opt ):

RUN mkdir -p /opt/yocto/sstate-cache

, , :

docker run ... -v /place/to/save/cache:/opt/yocto/sstate-cache

local.conf , :

SSTATE_DIR ?= "/opt/yocto/sstate-cache"

, , (scp, nfs, sneakernet).

, !

+3

Source: https://habr.com/ru/post/1650490/


All Articles