2019-12-12 20:33:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-05-03 12:12:57 +02:00
|
|
|
IMAGE=${DOCKER_IMAGE_NAME:-"element-desktop-dockerbuild"}
|
|
|
|
|
|
|
|
docker inspect "$IMAGE" 2> /dev/null > /dev/null
|
2020-02-17 21:10:58 +01:00
|
|
|
if [ $? != 0 ]; then
|
2022-05-03 12:12:57 +02:00
|
|
|
echo "Docker image $IMAGE not found. Have you run yarn run docker:setup?"
|
2020-02-17 21:10:58 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-12 20:33:29 +01:00
|
|
|
# Taken from https://www.electron.build/multi-platform-build#docker
|
2021-07-19 19:38:30 +02:00
|
|
|
# Pass through any vars prefixed with INDOCKER_, removing the prefix
|
2021-07-19 21:09:13 +02:00
|
|
|
docker run --rm -ti \
|
2024-01-02 18:39:20 +01:00
|
|
|
--platform linux/amd64 \
|
2021-07-19 21:09:13 +02:00
|
|
|
--env-file <(env | grep -E '^INDOCKER_' | sed -e 's/^INDOCKER_//') \
|
2019-12-12 20:33:29 +01:00
|
|
|
--env ELECTRON_CACHE="/root/.cache/electron" \
|
|
|
|
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
|
|
|
|
-v ${PWD}:/project \
|
2020-02-17 21:10:58 +01:00
|
|
|
-v ${PWD}/docker/node_modules:/project/node_modules \
|
|
|
|
-v ${PWD}/docker/.hak:/project/.hak \
|
2020-05-07 14:55:21 +02:00
|
|
|
-v ${PWD}/docker/.gnupg:/root/.gnupg \
|
2019-12-12 20:33:29 +01:00
|
|
|
-v ~/.cache/electron:/root/.cache/electron \
|
|
|
|
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
2022-05-03 12:12:57 +02:00
|
|
|
"$IMAGE" "$@"
|