File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
ARG RUNTIME
2
+ ARG BUILDPACK
2
3
3
- FROM hackmdio/buildpack:node-10-0baafb79 as BUILD
4
+ FROM $BUILDPACK as BUILD
4
5
5
6
COPY --chown=hackmd:hackmd . .
7
+ ENV QT_QPA_PLATFORM=offscreen
6
8
7
9
RUN set -xe && \
8
10
git reset --hard && \
@@ -18,6 +20,7 @@ RUN set -xe && \
18
20
19
21
FROM $RUNTIME
20
22
USER hackmd
23
+ ENV QT_QPA_PLATFORM=offscreen
21
24
WORKDIR /home/hackmd/app
22
25
COPY --chown=1500:1500 --from=BUILD /home/hackmd/app .
23
26
RUN npm install --production && npm cache clean --force && rm -rf /tmp/{core-js-banners,phantomjs}
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -euo pipefail
3
+ set -eo pipefail
4
4
set -x
5
5
6
+ if [[ -z $1 || -z $2 ]]; then
7
+ echo " build.sh [runtime image] [buildpack image]"
8
+ exit 1
9
+ fi
10
+
6
11
CURRENT_DIR=$( dirname " $BASH_SOURCE " )
7
12
8
13
GIT_SHA1=" $( git rev-parse HEAD) "
@@ -11,6 +16,6 @@ GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/
11
16
12
17
DOCKER_TAG=" ${GIT_TAG:- $GIT_SHORT_ID } "
13
18
14
- docker build --build-arg RUNTIME=hackmdio/runtime:node-10-d27854ef -t " hackmdio/hackmd:$DOCKER_TAG " -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
19
+ docker build --build-arg RUNTIME=$1 --build-arg BUILDPACK= $2 -t " hackmdio/hackmd:$DOCKER_TAG " -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
15
20
16
- docker build --build-arg RUNTIME=hackmdio/runtime:node-10-cjk-d27854ef -t " hackmdio/hackmd:$DOCKER_TAG -cjk" -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
21
+ docker build --build-arg RUNTIME=$1 --build-arg BUILDPACK= $2 -t " hackmdio/hackmd:$DOCKER_TAG -cjk" -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
You can’t perform that action at this time.
0 commit comments