Sign inSign up

almedso/yocto-bitbaker

By almedso

•Updated over 3 years ago

Image
0

5.4K

almedso/yocto-bitbaker repository overview

⁠Container for Yocto

⁠Features

  • Enabled for yocto out of the box (based on ubuntu 18.04; yocto prerequisites; yocto user)
  • git/ google repo
  • rsync for copying

⁠How to use the docker image

  • the images defines the following volumes:
    • /yocto/root - this is the home of all Yocto activities
    • /yocto/cache - this is the home of all cached downloads and shared states
    • /yocto/publish - this is where images and packages are copied to for publishing (i.e. a repo server can point to) (if called with docker-compose it will be published right away at port 8080)
  • Working directory is /yocto/root
  • The user yocto is created and should be used is injected (i.e. yocto must not run as root)

⁠Run Yocto builds

to get help run

docker run yocto-bitbaker help
# or
docker run yocto-bitbaker --help
# or
docker run yocto-bitbaker -?

For simplicity set as you want upfront:

$ export YOCTO_ROOT="~/my-yocto/workdir"
$ export YOCTO_DONWLOAD="/my-yocto/download"
$ export YOCTO_PUBLISH="/my-html-base"

It is expected that a build.sh script exists in ${YOCTO_ROOT} folder

$ docker run --rm --user $(id -u):$(id -g) \
    --volume $YOCTO_ROOT:/yocto/root \
    --volume $YOCTO_CACHE:/yocto/cache \
    --volume $YOCTO_PUBLISH:/yocto/publish \
    yocto-bitbaker

alternatively, you can inject a script-path relative to your $YOCTO_ROOT. e.g.

$ docker run --rm --user $(id -u):$(id -g) \
    --volume $YOCTO_ROOT:/yocto/root \
    --volume $YOCTO_CACHE:/yocto/cache \
    --volume $YOCTO_PUBLISH:/yocto/publish \
    yocto-bitbaker --script scripts/my-build-script.sh

will execute: *~/my-yocto/workdir/scripts/my-build-script.sh

or you can run interactively.

$ docker run --rm --user $(id -u):$(id -g) \
    --volume $YOCTO_ROOT:/yocto/root \
    --volume $YOCTO_CACHE:/yocto/cache \
    --volume $YOCTO_PUBLISH:/yocto/publish \
    --interactive --tty yocto-bitbaker

The environment variables are set for interactive and script convenience:

  • VOLUME_YOCTO_DIR
  • VOLUME_CACHE_DIR
  • VOLUME_PUBLISH_DIR

whereby the VOLUME_PUBLISH_DIR is not set if no volume is injected. whereby the VOLUME_YOCTO_DIR is like Container workdir.

You can also overwrite the workdir to your favorite yocto-root dir. and provide a different another internal mount dir for Yocto root:

I.e. /yocto/root can be changed. like:

$ WORKDIR=/new/work/dir
$ docker run --rm --memory 6G --user $(id -u) \
    --workdir $WORKDIR \
    --volume $YOCTO_ROOT:$WORKDIR \
    --volume $YOCTO_CACHE:/yocto/cache \
    --volume $YOCTO_PUBLISH:/yocto/publish \
    --interactive --tty yocto-bitbaker

A very simple script (without publishing) might look as follows:

#!/usr/bin/env bash
source sources/luminos/scripts/init-build-env
build core-image-minimal

Tag summary

Content type

Image

Digest

sha256:ee4a80df1…

Size

329.1 MB

Last updated

over 3 years ago

docker pull almedso/yocto-bitbaker