mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-04 20:51:49 +02:00
build-image.sh: Support building the image on Docker.
This commit is contained in:
parent
bdf3f8babc
commit
aa3227fbfb
1 changed files with 18 additions and 7 deletions
|
@ -1,14 +1,25 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -euo pipefail
|
||||||
|
|
||||||
TAG=dangerzone.rocks/dangerzone:latest
|
TAG=dangerzone.rocks/dangerzone:latest
|
||||||
|
|
||||||
echo "Building container image"
|
container_runtime() {
|
||||||
podman build --pull dangerzone/ -f Dockerfile --tag $TAG
|
if hash podman &>/dev/null; then
|
||||||
|
podman "$@"
|
||||||
|
elif hash docker &>/dev/null; then
|
||||||
|
docker "$@"
|
||||||
|
else
|
||||||
|
echo 'No container runtime installed.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo "Saving and compressing container image"
|
echo "Building container image" >&2
|
||||||
podman save $TAG | gzip > share/container.tar.gz
|
container_runtime build --pull dangerzone/ -f Dockerfile --tag "$TAG"
|
||||||
|
|
||||||
echo "Looking up the image id"
|
echo "Saving and compressing container image" >&2
|
||||||
podman images -q --filter=reference=$TAG > share/image-id.txt
|
container_runtime save "$TAG" | gzip > share/container.tar.gz
|
||||||
|
|
||||||
|
echo "Looking up the image id" >&2
|
||||||
|
container_runtime images -q --filter=reference="$TAG" > share/image-id.txt
|
||||||
|
|
Loading…
Reference in a new issue