From 540196b48863ca137b56d9c08bd9821e36918f7f Mon Sep 17 00:00:00 2001 From: dev-docker Date: Sat, 15 May 2021 13:14:07 +0000 Subject: [PATCH 1/5] fix(DEV): add global node-sass This fixes the case, where you bind-mount your own tileboard source directory into the dev container. Apparently, the node-sass module is compiled for the specdific machine. This seems to result in the `node-sass` executable not being found in the container, if the `node_modules` folder was compiled on a different machine (OS?). By adding node-sass globally in the container, it can be found even with a bind-mounted `tileboard-source` directory. --- Dockerfile.nightly | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.nightly b/Dockerfile.nightly index d05e050..e289896 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -12,6 +12,7 @@ RUN mkdir /tileboard-source \ && mkdir /tileboard \ && ln -s /tileboard build \ && yarn install \ + && npm install --global node-sass \ && yarn run build # Start Server @@ -31,4 +32,4 @@ COPY --from=dev /tileboard /tileboard # Start Server WORKDIR /tileboard EXPOSE 8000 -ENTRYPOINT python3 -m http.server \ No newline at end of file +ENTRYPOINT python3 -m http.server From 27d56a92cf2cc05b5a3226e2c40dbdcd52470445 Mon Sep 17 00:00:00 2001 From: dev-docker Date: Tue, 18 May 2021 23:04:40 +0000 Subject: [PATCH 2/5] add build-base for arm platforms alpine type build package --- Dockerfile.nightly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.nightly b/Dockerfile.nightly index d05e050..dcbc36f 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -2,7 +2,7 @@ FROM node:15-alpine AS dev # Install pre-requisites -RUN apk add --no-cache git python3 +RUN apk add --no-cache git python3 build-base # Fetch and build tileboard master branch RUN mkdir /tileboard-source \ From b14337ef0ad192a5a812b710a34311982537acdd Mon Sep 17 00:00:00 2001 From: dev-docker Date: Wed, 19 May 2021 15:12:57 +0000 Subject: [PATCH 3/5] add $DEVPLATFORM this adds the above variable to allow building the nightly image on the (fast) native build platform --- Dockerfile.nightly | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile.nightly b/Dockerfile.nightly index dcbc36f..9fa1f94 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -1,8 +1,12 @@ ## DEVELOPMENT IMAGE -FROM node:15-alpine AS dev +ARG DEVPLATFORM=${TARGETPLATFORM:-linux/amd64} +FROM --platform=$DEVPLATFORM node:15-alpine AS dev # Install pre-requisites -RUN apk add --no-cache git python3 build-base +RUN case $DEVPLATFORM in \ + *arm*) apk add --no-cache git python3 build-base ;; \ + *) apk add --no-cache git python3 ;; \ + esac # Fetch and build tileboard master branch RUN mkdir /tileboard-source \ From e427f472eb4a844c583882107e10dea78f186f30 Mon Sep 17 00:00:00 2001 From: dev-docker Date: Wed, 19 May 2021 15:33:08 +0000 Subject: [PATCH 4/5] debug output devplatform --- Dockerfile.nightly | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.nightly b/Dockerfile.nightly index 9fa1f94..9009ad2 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -3,7 +3,8 @@ ARG DEVPLATFORM=${TARGETPLATFORM:-linux/amd64} FROM --platform=$DEVPLATFORM node:15-alpine AS dev # Install pre-requisites -RUN case $DEVPLATFORM in \ +RUN echo DEVPLATFORM: $DEVPLATFORM \ + && case $DEVPLATFORM in \ *arm*) apk add --no-cache git python3 build-base ;; \ *) apk add --no-cache git python3 ;; \ esac From 8d55a3741b86fc85f744bd40e94df2e18689dd98 Mon Sep 17 00:00:00 2001 From: dev-docker Date: Wed, 19 May 2021 15:36:46 +0000 Subject: [PATCH 5/5] pass ARG to DEV image --- Dockerfile.nightly | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.nightly b/Dockerfile.nightly index 9009ad2..d39d592 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -3,6 +3,7 @@ ARG DEVPLATFORM=${TARGETPLATFORM:-linux/amd64} FROM --platform=$DEVPLATFORM node:15-alpine AS dev # Install pre-requisites +ARG DEVPLATFORM RUN echo DEVPLATFORM: $DEVPLATFORM \ && case $DEVPLATFORM in \ *arm*) apk add --no-cache git python3 build-base ;; \