mirror of
https://github.com/barnumbirr/alacritty-debian.git
synced 2024-06-01 18:12:13 +02:00
Add support for building with Podman
For those users who have both Docker and Podman installed, Docker will be used by default unless the new "-e" option is used to specify which container engine to use. For those users who only have Podman installed, the script will use it without having to specify a container engine.
This commit is contained in:
parent
35b5d97ab7
commit
919e572c8c
|
@ -4,7 +4,8 @@ This repository contains the source to build a Debian package for [alacritty](ht
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
If you have [Docker](https://www.docker.com/) installed locally, just run the following:
|
If you have [Docker](https://www.docker.com/) or [Podman](https://podman.io/)
|
||||||
|
installed locally, just run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
user@hostname$ ./build.sh
|
user@hostname$ ./build.sh
|
||||||
|
|
18
build.sh
18
build.sh
|
@ -6,7 +6,16 @@ IMAGE="debian:bullseye-slim"
|
||||||
TARGET="$(dirname "$0" | xargs realpath)"
|
TARGET="$(dirname "$0" | xargs realpath)"
|
||||||
VERSION="v0.10.1"
|
VERSION="v0.10.1"
|
||||||
|
|
||||||
while getopts "v:i:h" opt
|
if hash docker; then
|
||||||
|
ENGINE="docker"
|
||||||
|
elif hash podman; then
|
||||||
|
ENGINE="podman"
|
||||||
|
else
|
||||||
|
echo "ERROR: A supported container engine was not found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while getopts "v:i:e:h" opt
|
||||||
do
|
do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
v)
|
v)
|
||||||
|
@ -15,8 +24,11 @@ do
|
||||||
i)
|
i)
|
||||||
IMAGE="$OPTARG"
|
IMAGE="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
e)
|
||||||
|
ENGINE="$OPTARG"
|
||||||
|
;;
|
||||||
h)
|
h)
|
||||||
echo "Usage: $0 [-i image] [-v version]"
|
echo "Usage: $0 [-i image] [-v version] [-e docker|podman]"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -26,7 +38,7 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
docker run --rm --name alacritty-build-$$ \
|
${ENGINE} run --rm --name alacritty-build-$$ \
|
||||||
--volume "$TARGET:/target" \
|
--volume "$TARGET:/target" \
|
||||||
--workdir /target \
|
--workdir /target \
|
||||||
--env "VERSION=$VERSION" \
|
--env "VERSION=$VERSION" \
|
||||||
|
|
Loading…
Reference in a new issue