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