diff --git a/BuildSourceImage.sh b/BuildSourceImage.sh index 4fcb55b..480e0f5 100755 --- a/BuildSourceImage.sh +++ b/BuildSourceImage.sh @@ -78,5 +78,14 @@ buildah rm ${SRC_CTR} # buildah tag $IMG $SRC_IMAGE +## if an output directory is provided then save a copy to it +## XXX(vbatts) this is not working inside a container like `quay.io/buildah/stable` yet +if [ -n "${OUTPUT_DIR}" ] ; then + mkdir -p "${OUTPUT_DIR}" + skopeo copy containers-storage:"${IMG}" oci:"${OUTPUT_DIR}"/ +fi + # Push SRC_IMAGE to Registry # buildah push $SRC_IMAGE REGISTRY_NAME/$SRC_IMAGE + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a851ab8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM quay.io/buildah/stable +RUN dnf install -y skopeo && \ + dnf clean all && \ + mkdir -p /output +COPY . /usr/local/bin/ +VOLUME /var/lib/container +VOLUME /output +ENV OUTPUT_DIR=/output +ENTRYPOINT ["/usr/local/bin/BuildSourceImage.sh"]