diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-07-07 08:50:53 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 08:50:53 +0530 |
commit | 4669e0327d91ab4e203bd7fbfdc59c13601374ad (patch) | |
tree | 6d1ed095568f28898c1db4e9eb9514343b9e15d5 /Dockerfile | |
parent | fix: fix breaking tab component (diff) | |
download | ferdium-app-4669e0327d91ab4e203bd7fbfdc59c13601374ad.tar.gz ferdium-app-4669e0327d91ab4e203bd7fbfdc59c13601374ad.tar.zst ferdium-app-4669e0327d91ab4e203bd7fbfdc59c13601374ad.zip |
Building ferdi on an ARM machine (#1611)
Moving away from electron-builder base image (since it doesn't support building on ARM yet)
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile index c94b42539..b6526460f 100644 --- a/Dockerfile +++ b/Dockerfile | |||
@@ -1,24 +1,47 @@ | |||
1 | FROM electronuserland/builder:14 as builder | 1 | # Note: Before running this file, you should have already cloned the git repo + submodules on the host machine. This is used when actively developing on your local machine, but you want to build for a different architecture |
2 | |||
3 | FROM node:fermium-buster as builder | ||
4 | |||
5 | # TODO: Need to setup a non-root user for security purposes | ||
6 | |||
7 | ENV PATH="/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/lib:/usr/include:/usr/share" | ||
8 | |||
9 | ARG DEBIAN_FRONTEND=noninteractive | ||
10 | # Note: This is added for building on ARM machines | ||
11 | ARG USE_SYSTEM_FPM="true" | ||
12 | # Note: Added to bypass the error with missing git repo information for the 'preval-build-info' module | ||
13 | ARG PREVAL_BUILD_INFO_PLACEHOLDERS=true | ||
14 | |||
15 | RUN apt-get update \ | ||
16 | && apt-get install -y rpm ruby gem \ | ||
17 | && gem install fpm --no-ri --no-rdoc --no-document | ||
2 | 18 | ||
3 | WORKDIR /usr/src/ferdi | 19 | WORKDIR /usr/src/ferdi |
4 | 20 | ||
5 | COPY package*.json ./ | 21 | COPY package*.json ./ |
6 | COPY lerna.json ./ | 22 | COPY lerna.json ./ |
7 | 23 | ||
8 | # Note: This is being set to bypass the error with missing git repo information for the 'preval-build-info' module | ||
9 | ENV PREVAL_BUILD_INFO_PLACEHOLDERS=true | ||
10 | |||
11 | RUN npm i -g node-gyp@8.0.0 \ | 24 | RUN npm i -g node-gyp@8.0.0 \ |
12 | && npm config set node_gyp "$(which node-gyp)" \ | 25 | && npm config set node_gyp "$(which node-gyp)" |
13 | && npx lerna bootstrap | ||
14 | 26 | ||
15 | COPY . . | 27 | COPY . . |
16 | 28 | ||
17 | RUN cd recipes && npm i && npm run package && cd .. | 29 | # Note: Ideally this needs to be done before the COPY step - BUT moving this here resolves the issue with `preval-build-info-cli` not being found |
30 | RUN npx lerna bootstrap | ||
31 | |||
32 | RUN cd recipes \ | ||
33 | && npm i \ | ||
34 | && npm run package \ | ||
35 | && cd .. | ||
36 | |||
18 | RUN npm run build | 37 | RUN npm run build |
19 | 38 | ||
39 | # -------------------------------------------------------------------------------------------- | ||
40 | |||
20 | FROM busybox | 41 | FROM busybox |
21 | 42 | ||
43 | # TODO: Need to setup a non-root user for security purposes | ||
44 | |||
22 | WORKDIR /ferdi | 45 | WORKDIR /ferdi |
23 | 46 | ||
24 | COPY --from=builder /usr/src/ferdi/out/* /ferdi/ | 47 | COPY --from=builder /usr/src/ferdi/out/* /ferdi/ |