Skip to content

Commit e75611d

Browse files
author
Sean Sundberg
authored
Fix container file build on arm architecture (#155)
* Update package.json * Simplify Dockerfile build * Add flag for ARM build Signed-off-by: Sean Sundberg <seansund@us.ibm.com>
1 parent 03b71f5 commit e75611d

File tree

4 files changed

+95
-86
lines changed

4 files changed

+95
-86
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
logs
22
.git
33
*.md
4+
node_modules/
5+
.github/
6+
chart/

Dockerfile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,19 @@ FROM registry.access.redhat.com/ubi8/nodejs-16:1-72 AS builder
22

33
USER root
44

5-
RUN dnf -y install autoconf automake diffutils file && \
5+
RUN dnf -y install autoconf automake diffutils file zlib && \
66
dnf clean all
77

88
USER default
99

10+
ENV NODE_ENV=dev CPPFLAGS="-DPNG_ARM_NEON_OPT=0"
1011
WORKDIR /opt/app-root/src
1112

1213
COPY --chown=default:root . .
1314
RUN npm ci && \
1415
npm run build
1516

16-
FROM registry.access.redhat.com/ubi8/nodejs-16-minimal:1-79
17-
18-
USER 1001
19-
20-
WORKDIR /opt/app-root/src
21-
22-
COPY --from=builder --chown=1001:0 /opt/app-root/src/dist ./dist
23-
COPY --chown=1001:0 package.json package-lock.json ./
24-
COPY --chown=1001:0 server ./server
25-
26-
ENV NODE_ENV=production
27-
RUN chmod -R g+w ./dist
28-
RUN npm ci
29-
30-
ENV HOST=0.0.0.0 PORT=3000
17+
ENV NODE_ENV=production HOST=0.0.0.0 PORT=3000
3118

3219
EXPOSE 3000/tcp
3320

package-lock.json

Lines changed: 88 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"ibmcloud-appid": "^6.2.5",
1515
"passport": "^0.5.2",
1616
"passport-oauth": "^1.0.0",
17-
"react-inject-env": "^2.1.0",
1817
"yaml": "^2.0.1"
1918
},
2019
"scripts": {
@@ -104,6 +103,7 @@
104103
"react-ga4": "^1.4.1",
105104
"react-hot-loader": "^4.13.0",
106105
"react-imported-component": "^6.5.3",
106+
"react-inject-env": "^2.1.0",
107107
"react-markdown": "^8.0.2",
108108
"react-router-dom": "^6.2.2",
109109
"react-scripts": "5.0.0",

0 commit comments

Comments
 (0)