mirror of
https://github.com/vector-im/element-desktop.git
synced 2024-09-05 03:50:06 +00:00
23 lines
855 B
Bash
Executable file
23 lines
855 B
Bash
Executable file
#!/bin/bash
|
|
|
|
IMAGE=${DOCKER_IMAGE_NAME:-"element-desktop-dockerbuild"}
|
|
|
|
docker inspect "$IMAGE" 2> /dev/null > /dev/null
|
|
if [ $? != 0 ]; then
|
|
echo "Docker image $IMAGE not found. Have you run yarn run docker:setup?"
|
|
exit 1
|
|
fi
|
|
|
|
# Taken from https://www.electron.build/multi-platform-build#docker
|
|
# Pass through any vars prefixed with INDOCKER_, removing the prefix
|
|
docker run --rm -ti \
|
|
--env-file <(env | grep -E '^INDOCKER_' | sed -e 's/^INDOCKER_//') \
|
|
--env ELECTRON_CACHE="/root/.cache/electron" \
|
|
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
|
|
-v ${PWD}:/project \
|
|
-v ${PWD}/docker/node_modules:/project/node_modules \
|
|
-v ${PWD}/docker/.hak:/project/.hak \
|
|
-v ${PWD}/docker/.gnupg:/root/.gnupg \
|
|
-v ~/.cache/electron:/root/.cache/electron \
|
|
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
|
"$IMAGE" "$@"
|