Dockerfile and export image if OUTPUT_DIR

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2019-08-14 11:15:46 -04:00
parent 22a20a5e28
commit f5db5f704f
Signed by: vbatts
GPG key ID: 10937E57733F1362
2 changed files with 18 additions and 0 deletions

View file

@ -78,5 +78,14 @@ buildah rm ${SRC_CTR}
# #
buildah tag $IMG $SRC_IMAGE 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 # Push SRC_IMAGE to Registry
# buildah push $SRC_IMAGE REGISTRY_NAME/$SRC_IMAGE # buildah push $SRC_IMAGE REGISTRY_NAME/$SRC_IMAGE
# vim:set shiftwidth=4 softtabstop=4 expandtab:

9
Dockerfile Normal file
View file

@ -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"]