No description
Vincent Batts
8e438c7a6d
This may be a pattern we can do for some of the more useful functions. But for now, folks can build, push, etc. and once they skopeo copy an image to their host, they can ```bash ./BuildSourceImage unpack <src> <dest> ``` and it will be nicely exposed in the container build too Also included, exporting the defaults into the bats test for easier direct running. Perhaps we can move the srpm caching into bats too, so the Makefile target isn't strictly required. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com> |
||
---|---|---|
test | ||
.gitignore | ||
.travis.yml | ||
BuildSourceImage.sh | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
README.md |
BuildSourceImage
Tool to build a source image. The goal is to make retrieving the source code used to make a container image easier for users to obtain, using the standard OCI protocols and image formats.
Usage
$> ./BuildSourceImage.sh -h
BuildSourceImage.sh version 0.1
Usage: BuildSourceImage.sh [-D] [-b <path>] [-c <path>] [-e <path>] [-r <path>] [-o <path>] [-i <image>] [-p <image>] [-l] [-d <drivers>]
-b <path> base path for source image builds
-c <path> build context for the container image. Can be provided via CONTEXT_DIR env variable
-e <path> extra src for the container image. Can be provided via EXTRA_SRC_DIR env variable
-s <path> directory of SRPMS to add. Can be provided via SRPM_DIR env variable
-o <path> output the OCI image to path. Can be provided via OUTPUT_DIR env variable
-d <drivers> enumerate specific source drivers to run
-l list the source drivers available
-i <image> image reference to fetch and inspect its rootfs to derive sources
-p <image> push source image to specified reference after build
-D debuging output. Can be set via DEBUG env variable
-h this usage information
-v version
Nicely usable inside a container:
$> podman build -t containers/buildsourceimage .
$> mkdir ./output/
$> podman run -it -v $(pwd)/output/:/output/ -v $(pwd)/SRCRPMS/:/data/ -u $(id -u) containers/buildsourceimage -s /data/
Examples
- Building from a fetched reference
- Building from a directory of src.rpms:
- Building from a directory of src.rpms and pushing it to a simple registry:
Use Cases
- Build a source image from an existing container image by introspection
- Build a source code image from a collection of known
.src.rpm
's - Include additional build context into the source image
- Include extra sources use