Add missing and IMPORTANT script for Docker build

This commit is contained in:
gardouille 2023-07-10 09:38:09 +02:00
parent ba2110bd92
commit 8e8fa3e66d
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
2 changed files with 44 additions and 4 deletions

View File

@ -4,16 +4,22 @@ This repository contains the source to build an archive for both
[Vaultwarden](https://github.com/dani-garcia/vaultwarden) and
[Web Vault builds for Vaultwarden](https://github.com/dani-garcia/bw_web_builds).
## Usage
## Usage Docker
If you have [Docker](https://www.docker.com/) installed locally, just run the following:
```bash
user@hostname$ ./build-in-container.sh
```
By default this will build the last version on Debian Bullseye and put the
archive to `target/` directory.
## Build on current host
```bash
user@hostname$ ./build.sh
```
By default this will build the last version on Debian Bullseye and put the
archive to target/ directory.
## References
* [ayosec/polybar-debian](https://github.com/ayosec/polybar-debian)

34
build-in-container.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -eu
TARGET="$(dirname "$0" | xargs realpath)"
VERSION="3.4.2"
IMAGE="debian:bullseye"
while getopts "v:i:h" opt
do
case "$opt" in
v)
VERSION="$OPTARG"
;;
i)
IMAGE="$OPTARG"
;;
h)
echo "Usage: $0 [-i image] [-v version]"
exit 0
;;
*)
exit 1
;;
esac
done
docker run --rm \
--name vault-build-$$ \
-v "$TARGET:/target" \
-w /target \
--user root \
"$IMAGE" \
sh build.sh