2019-12-12 20:33:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-24 13:48:37 +01:00
|
|
|
docker inspect element-desktop-dockerbuild 2> /dev/null > /dev/null
|
2020-02-17 21:10:58 +01:00
|
|
|
if [ $? != 0 ]; then
|
2020-11-24 13:48:37 +01:00
|
|
|
echo "Docker image element-desktop-dockerbuild 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
|
|
|
|
docker run --rm -ti \
|
2021-07-19 19:38:30 +02:00
|
|
|
# Pass through any vars prefixed with INDOCKER_, removing the prefix
|
|
|
|
--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 \
|
2020-11-24 13:48:37 +01:00
|
|
|
element-desktop-dockerbuild "$@"
|