aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.dockerignore4
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--Dockerfile37
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
140docker build -t ferdi-package . 140docker build -t ferdi-package-`uname -m` .
141``` 141```
142 142
143The above will place all the built artifacts into the `/ferdi` folder within the image. 143The 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 @@
1FROM 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
3FROM node:fermium-buster as builder
4
5# TODO: Need to setup a non-root user for security purposes
6
7ENV PATH="/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/lib:/usr/include:/usr/share"
8
9ARG DEBIAN_FRONTEND=noninteractive
10# Note: This is added for building on ARM machines
11ARG USE_SYSTEM_FPM="true"
12# Note: Added to bypass the error with missing git repo information for the 'preval-build-info' module
13ARG PREVAL_BUILD_INFO_PLACEHOLDERS=true
14
15RUN apt-get update \
16 && apt-get install -y rpm ruby gem \
17 && gem install fpm --no-ri --no-rdoc --no-document
2 18
3WORKDIR /usr/src/ferdi 19WORKDIR /usr/src/ferdi
4 20
5COPY package*.json ./ 21COPY package*.json ./
6COPY lerna.json ./ 22COPY 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
9ENV PREVAL_BUILD_INFO_PLACEHOLDERS=true
10
11RUN npm i -g node-gyp@8.0.0 \ 24RUN 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
15COPY . . 27COPY . .
16 28
17RUN 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
30RUN npx lerna bootstrap
31
32RUN cd recipes \
33 && npm i \
34 && npm run package \
35 && cd ..
36
18RUN npm run build 37RUN npm run build
19 38
39# --------------------------------------------------------------------------------------------
40
20FROM busybox 41FROM busybox
21 42
43# TODO: Need to setup a non-root user for security purposes
44
22WORKDIR /ferdi 45WORKDIR /ferdi
23 46
24COPY --from=builder /usr/src/ferdi/out/* /ferdi/ 47COPY --from=builder /usr/src/ferdi/out/* /ferdi/