Skip to content

Commit

Permalink
fix: building mfe image on arm64
Browse files Browse the repository at this point in the history
Additional requirements are required, and we cannot download the pact binary on
arm64: pact-foundation/pact-js-core#264

Close #31.
  • Loading branch information
regisb committed Mar 14, 2022
1 parent 0ed49fe commit 9292fcd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tutormfe/templates/mfe/build/mfe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ FROM docker.io/node:12-bullseye-slim AS base
RUN apt update \
&& apt install -y git \
# required for cwebp-bin
gcc git libgl1 libxi6 make
gcc git libgl1 libxi6 make \
# additionally required for gifsicle, mozjpeg, and optipng (on arm)
autoconf libtool pkg-config zlib1g-dev \
# additionally required for node-sass (on arm)
python g++

RUN mkdir -p /openedx/app /openedx/env
WORKDIR /openedx/app
Expand Down Expand Up @@ -32,10 +36,13 @@ COPY --from=i18n /openedx/i18n/i18n-merge.js /openedx/i18n/i18n-merge.js
RUN /openedx/i18n/i18n-merge.js /openedx/app/src/i18n/messages /openedx/i18n/{{ app["name"] }} /openedx/app/src/i18n/messages
######## {{ app["name"] }} (dev)
FROM base AS {{ app["name"] }}-dev

COPY --from={{ app["name"] }}-src /openedx/app/package.json /openedx/app/package.json
COPY --from={{ app["name"] }}-src /openedx/app/package-lock.json /openedx/app/package-lock.json
ARG NPM_REGISTRY=https://registry.npmjs.org/
{{ patch("mfe-dockerfile-pre-npm-install") }}
{# We define this environment variable to bypass an issue with the installation of pact https://github.com/pact-foundation/pact-js-core/issues/264 #}
ENV PACT_SKIP_BINARY_INSTALL=true
RUN npm install --no-audit --no-fund --registry=$NPM_REGISTRY \
&& rm -rf ~/.npm
{{ patch("mfe-dockerfile-post-npm-install") }}
Expand Down

0 comments on commit 9292fcd

Please sign in to comment.