mirror of
https://github.com/barnumbirr/alacritty-debian.git
synced 2024-05-02 20:03:11 +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
|
||||
|
||||
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
|
||||
user@hostname$ ./build.sh
|
||||
|
|
18
build.sh
18
build.sh
|
@ -6,7 +6,16 @@ IMAGE="debian:bullseye-slim"
|
|||
TARGET="$(dirname "$0" | xargs realpath)"
|
||||
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
|
||||
case "$opt" in
|
||||
v)
|
||||
|
@ -15,8 +24,11 @@ do
|
|||
i)
|
||||
IMAGE="$OPTARG"
|
||||
;;
|
||||
e)
|
||||
ENGINE="$OPTARG"
|
||||
;;
|
||||
h)
|
||||
echo "Usage: $0 [-i image] [-v version]"
|
||||
echo "Usage: $0 [-i image] [-v version] [-e docker|podman]"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
|
@ -26,7 +38,7 @@ do
|
|||
done
|
||||
|
||||
main() {
|
||||
docker run --rm --name alacritty-build-$$ \
|
||||
${ENGINE} run --rm --name alacritty-build-$$ \
|
||||
--volume "$TARGET:/target" \
|
||||
--workdir /target \
|
||||
--env "VERSION=$VERSION" \
|
||||
|
|
Loading…
Reference in a new issue