packer icon indicating copy to clipboard operation
packer copied to clipboard

Possible to use a docker to build on different SYstem?

Open gino8080 opened this issue 4 years ago • 3 comments

Hello like subject

I was wondering if it's possible to use docker images to build for different system (like Electron does)

I'm on OSX atm and I wish to build for Windows and Linux

thankyou!

gino8080 avatar Apr 01 '20 09:04 gino8080

It should be possibe to build for linux using docker. But I am not sure if you have docker images for windows ? @gino8080

a7ul avatar Apr 01 '20 09:04 a7ul

On electron I can package a window executable using a command like this:

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

gino8080 avatar Apr 01 '20 09:04 gino8080

Interesting approach actually (using wine to build windows binaries). I ll take a look when I can. Thanks for letting me know.

a7ul avatar Apr 01 '20 10:04 a7ul