Docker images are built on each release of yplatform,
and pushed to https://hub.docker.com/u/ysoftwareab .
These images can then be used in CIs to skip not only the time-consuming process of bootstrapping, but also to increase the determinism of the execution, since there's absolute control on when and how the execution environment changes.
The images have
- an
yp:ypsudoer user, intended as default user (don't useroot) - a
/yplatformgit clone - a
/yplatform.bootstrappedmarker to denote that this machine has been bootstrapped- the file contents are the git hash of the
/yplatformHEAD
- the file contents are the git hash of the
- no aptitude cache (to reduce size)
- shallow git clones (to reduce size)
- linuxbrew installed, along with a collection of minimal/common packages
A run utility will make it easy to run ephemeral (--rm) instances of these images.
It takes a FLAVOUR argument as following:
./run vanillawill run the vanilla image that our image is based on e.g.ubuntu-20.04:latest./run yp-minimalor./run yp-commonwill run the image associated with the currentyplatformversion./run yp-minimal:<tag>or./run yp-common:<tag>will run the image with the given tag
NOTE No --help argument exists yet. Check the sourcecode for available arguments.
A build utility will make it easy to build a local image based on the Dockerfile.
NOTE No --help argument exists yet. Check the sourcecode for available arguments.
Same images can be used locally to run make docker-ci
which will spin a local Docker container, to mimic the environment in which the CI pipeline runs.
We say mimic because there's no access to the same environment variables, or the same bind mounts.
The container will have
- a
/yplatform/docker-cito denote that this machine is a docker-ci one - a bind mount of the repository, to the same location relative to
$HOMEas on the host e.g./Users/andrei/git/repoon host will be/home/yp/git/repoon the container - a sudoer user with the same UID:GID as on the host, same name, possibly same group as well (if no collision)