Answer a question

I got following error message, If I try to build my electron application in my docker container.

build-electron_1 | rcedit.exe failed with exit code 193. wine: Bad EXE format for Z:\app\node_modules\rcedit\bin\rcedit.exe.

FROM node:10-stretch

RUN apt update
RUN apt install wine freetype
version: '3.1'

services:
 build-electron:
    build:
      context: .
      dockerfile: ./Dockerfile
    volumes:
      - ./:/app
    working_dir: /app
    command: "make install rebuild-node-sass build-package"

make install only triggers yarn (install) and make rebuild-node-sass will start npm rebuild node-sass

"package-linux": "electron-packager ./build projectName --platform=linux --arch=x64 --overwrite --packageManager=yarn --prune=true --out=out/linux --asar --icon=build/favicon.ico",
"package-windows": "electron-packager ./build projectName --platform=win32 --arch=all --overwrite --packageManager=yarn --prune=true --out=out/windows --asar --icon=icon/icon.png.ico",

Answers

My solution is now this:

FROM node:10

RUN dpkg --add-architecture i386 && apt-get update && apt-get install wine wine32 -y

RUN npm install electron-packager -g

VOLUME /electron
WORKDIR /electron

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐