How to use docker container to build app for windows platform generated by vue-cli-plugin-electron-builder

Viewed 697

I have generated an Electron app with Vue using vue-cli-plugin-electron-builder. I'm using Ubuntu 20.04 and I want to build that app for both Windows and Linux. I want to use Docker because I don't want to mess with installing different versions of wine that are needed. There are a few docker images on electron-builder site (https://www.electron.build/multi-platform-build), but I don't know how to use them in my project.

1 Answers

In case this helps.

https://www.electron.build/multi-platform-build#build-electron-app-using-docker-on-a-local-machine

docker run --rm -ti \
 --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
 --env ELECTRON_CACHE="/root/.cache/electron" \
 --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
 -v ${PWD}:/project \
 -v ${PWD##*/}-node-modules:/project/node_modules \
 -v ~/.cache/electron:/root/.cache/electron \
 -v ~/.cache/electron-builder:/root/.cache/electron-builder \
 electronuserland/builder:wine
Related