Skip to content

Commit

Permalink
Add support for arm64 build
Browse files Browse the repository at this point in the history
Signed-off-by: YadominJinta <i@yadom.in>
  • Loading branch information
YadominJinta committed Jul 5, 2021
1 parent 1bdedf1 commit 9c280b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion deployments/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
ARG RUNTIME
ARG BUILDPACK

FROM hackmdio/buildpack:node-10-0baafb79 as BUILD
FROM $BUILDPACK as BUILD

COPY --chown=hackmd:hackmd . .
ENV QT_QPA_PLATFORM=offscreen

RUN set -xe && \
git reset --hard && \
Expand All @@ -18,6 +20,7 @@ RUN set -xe && \

FROM $RUNTIME
USER hackmd
ENV QT_QPA_PLATFORM=offscreen
WORKDIR /home/hackmd/app
COPY --chown=1500:1500 --from=BUILD /home/hackmd/app .
RUN npm install --production && npm cache clean --force && rm -rf /tmp/{core-js-banners,phantomjs}
Expand Down
11 changes: 8 additions & 3 deletions deployments/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail
set -eo pipefail
set -x

if [[ -z $1 || -z $2 ]];then
echo "build.sh [runtime image] [buildpack image]"
exit 1
fi

CURRENT_DIR=$(dirname "$BASH_SOURCE")

GIT_SHA1="$(git rev-parse HEAD)"
Expand All @@ -11,6 +16,6 @@ GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/

DOCKER_TAG="${GIT_TAG:-$GIT_SHORT_ID}"

docker build --build-arg RUNTIME=hackmdio/runtime:node-10-d27854ef -t "hackmdio/hackmd:$DOCKER_TAG" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
docker build --build-arg RUNTIME=$1 --build-arg BUILDPACK=$2 -t "hackmdio/hackmd:$DOCKER_TAG" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."

docker build --build-arg RUNTIME=hackmdio/runtime:node-10-cjk-d27854ef -t "hackmdio/hackmd:$DOCKER_TAG-cjk" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
docker build --build-arg RUNTIME=$1 --build-arg BUILDPACK=$2 -t "hackmdio/hackmd:$DOCKER_TAG-cjk" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."

0 comments on commit 9c280b0

Please sign in to comment.