Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a builder image #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ifireball
Copy link
Collaborator

Add files for creating a builder container image that can be used for
building images with Vagrant environments in them based on the base
image.

The builder image is essentially the base image with skopeo and
buildah added and with a derive.sh script that lets one bake
images without having to run the image being built as a container inside
the image that is building it.

The builder image image accomplishes this feat by bind-mounting the
locations inside the image being build that store VM and Vagrant-related
information onto itself and them running the bake.sh script ao tha
that baked image ends up being stored in the built image.

The builder image also supports pushing the built images to a remote
container repository.

During the build process, the builder image stores intermediate
container data in a hidden directory in the /workspace directory which
should be a mounted volume. Since it is likely that the Vagrant
application data will also come from that directory, the bake.sh
script in the base image had been changed to not copy hidden files into
the Vagrant environment.

Optimised the `bake.sh` script to enable running it on an already baked
image to add images to it without adding new copies of existing images.

This is done by avoiding deletion of the Vagrant box files and instead
making hard-links between the copies of the Vagrant images in the
$VAGRANT_HOME directory to the copies in the libvirt storage pool.

Also enabled a 'box-only` bake mode that allows creating images that
contain cached cipies of Vagrant boxes without also containing
pre-configured VMs. This allows creating families of images that
contain different VM configurations but all share the layer that contain
the large Box image file.

Along the way also removed some packages from the base image that caused
security alerts to show up in quay.io.

Signed-off-by: Barak Korren <[email protected]>
Add files for creating a `builder` container image that can be used for
building images with Vagrant environments in them based on the `base`
image.

The builder image is essentially the `base` image with `skopeo` and
`buildah` added and with a `derive.sh` script that lets one `bake`
images without having to run the image being built as a container inside
the image that is building it.

The builder image image accomplishes this feat by bind-mounting the
locations inside the image being build that store VM and Vagrant-related
information onto itself and them running the `bake.sh` script ao tha
that baked image ends up being stored in the built image.

The builder image also supports pushing the built images to a remote
container repository.

During the build process, the builder image stores intermediate
container data in a hidden directory in the /workspace directory which
should be a mounted volume. Since it is likely that the Vagrant
application data will also come from that directory, the `bake.sh`
script in the base image had been changed to not copy hidden files into
the Vagrant environment.

Signed-off-by: Barak Korren <[email protected]>
@ifireball ifireball requested a review from galitf December 11, 2019 09:10
@lmilbaum lmilbaum self-requested a review December 11, 2019 10:11
Copy link

@lmilbaum lmilbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README file is missing. There is already a repo which does something similar.

@ifireball
Copy link
Collaborator Author

I know about the work that was previously done WRT running Vagrant in a container, the work here already supersedes it in many ways

@lmilbaum
Copy link

Then, what is the value in starting a new repo?

@ifireball
Copy link
Collaborator Author

ifireball commented Dec 11, 2019

The code here is not technically derived from the code in the other repo, so putting it there would have not be useful for understanding it, also the name of the other repo includes "systemd" while this project intentionally eschews using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants