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 | |
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)
-rw-r--r-- | .dockerignore | 4 | ||||
-rw-r--r-- | CONTRIBUTING.md | 2 | ||||
-rw-r--r-- | Dockerfile | 37 |
3 files changed, 35 insertions, 8 deletions
diff --git a/.dockerignore b/.dockerignore index 00a94efd2..8787a6a56 100644 --- a/.dockerignore +++ b/.dockerignore | |||
@@ -1,7 +1,11 @@ | |||
1 | .all-contributorsrc | ||
2 | .devcontainer | ||
1 | .dockerignore | 3 | .dockerignore |
4 | .editorconfig | ||
2 | .husky/ | 5 | .husky/ |
3 | .stage | 6 | .stage |
4 | .tmp | 7 | .tmp |
8 | .vscode | ||
5 | **/.DS_Store | 9 | **/.DS_Store |
6 | **/.env | 10 | **/.env |
7 | **/.git* | 11 | **/.git* |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fcc868c2..c26de8a12 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md | |||
@@ -137,7 +137,7 @@ cd recipes && npm i && npm run package | |||
137 | ### Using Docker to build a linux-targetted packaged app | 137 | ### Using Docker to build a linux-targetted packaged app |
138 | 138 | ||
139 | ```bash | 139 | ```bash |
140 | docker build -t ferdi-package . | 140 | docker build -t ferdi-package-`uname -m` . |
141 | ``` | 141 | ``` |
142 | 142 | ||
143 | The above will place all the built artifacts into the `/ferdi` folder within the image. | 143 | The above will place all the built artifacts into the `/ferdi` folder within the image. |
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/ |