mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-22 18:18:55 +00:00
- Should address #375 (building a win app from linux) under Docker, thanks @dipenpatel235 for the suggestion to use `wine32` at https://github.com/jiahaog/nativefier/issues/375#issuecomment-304247033 - Regarding #461, Docker build seems fine but it was already fine for some time, not sure what happened. Also clean up a bit the Dockerfile using suggestions from [hadolint](https://github.com/lukasmartinelli/hadolint/).
This commit is contained in:
parent
db74db8911
commit
2b377a7916
42
Dockerfile
42
Dockerfile
@ -1,35 +1,33 @@
|
|||||||
FROM node:8-alpine
|
FROM node:8-stretch
|
||||||
LABEL description="Alpine image to build nativfier apps"
|
LABEL description="Debian image to build nativefier apps"
|
||||||
|
|
||||||
### Dependencies
|
# Get wine32, not 64, to work around binary incompatibility with rcedit.
|
||||||
RUN apk add --no-cache \
|
# https://github.com/jiahaog/nativefier/issues/375#issuecomment-304247033
|
||||||
wine \
|
# Forced us to use Debian rather than Alpine, which doesn't do multiarch.
|
||||||
freetype \
|
RUN dpkg --add-architecture i386
|
||||||
imagemagick \
|
|
||||||
### make symbolic link to use `wine`
|
# Install dependencies
|
||||||
&& ln -s /usr/bin/wine64 /usr/bin/wine
|
RUN apt-get update \
|
||||||
|
&& apt-get --yes install wine32 imagemagick \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Add sources
|
# Add sources
|
||||||
COPY . /nativefier
|
COPY . /nativefier
|
||||||
|
|
||||||
### Build app package for nativefier installation
|
# Build nativefier and link globally
|
||||||
RUN cd /nativefier/app && npm install \
|
WORKDIR /nativefier/app
|
||||||
# Build and install nativefier binary
|
RUN npm install
|
||||||
&& cd /nativefier && npm install && npm run build \
|
WORKDIR /nativefier
|
||||||
# Expose globally
|
RUN npm install && npm run build && npm link
|
||||||
&& npm link
|
|
||||||
|
|
||||||
### Use 1000 as default user not root
|
# Use 1000 as default user not root
|
||||||
USER 1000
|
USER 1000
|
||||||
|
|
||||||
### Check that installation was sucessful and cache electron installations.
|
# Run a {lin,mac,win} build: 1. to check installation was sucessful,
|
||||||
### Ensures that no addtional download will be needed at `docker run` runtime.
|
# 2. to cache electron distributables and avoid downloads at runtime.
|
||||||
RUN nativefier https://github.com/jiahaog/nativefier /tmp/nativefier \
|
RUN nativefier https://github.com/jiahaog/nativefier /tmp/nativefier \
|
||||||
&& nativefier -p osx https://github.com/jiahaog/nativefier /tmp/nativefier \
|
&& nativefier -p osx https://github.com/jiahaog/nativefier /tmp/nativefier \
|
||||||
# TODO: windows are currently not possible, because of non 64-bit `node-rcedit`,
|
&& nativefier -p windows https://github.com/jiahaog/nativefier /tmp/nativefier \
|
||||||
# see https://github.com/electron/node-rcedit/issues/22.
|
|
||||||
# && nativefier -p windows https://github.com/jiahaog/nativefier /tmp/nativefier \
|
|
||||||
#remove not need test aplication
|
|
||||||
&& rm -rf /tmp/nativefier
|
&& rm -rf /tmp/nativefier
|
||||||
|
|
||||||
ENTRYPOINT ["nativefier"]
|
ENTRYPOINT ["nativefier"]
|
||||||
|
Loading…
Reference in New Issue
Block a user