using a smaller image for the node build and fixing the arm build too

This commit is contained in:
Valentin Vieriu 2018-12-04 12:10:14 +01:00
parent 18e3bd4f0d
commit 13c0ac0ea3
3 changed files with 15 additions and 40 deletions

View file

@ -1 +1,2 @@
web/node_modules
.git

View file

@ -6,7 +6,7 @@ FROM $image as system
ARG localbuild
RUN echo "LOCALBUILD=$localbuild"
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://'$localbuild'tw.archive.ubuntu.com/#' /etc/apt/sources.list; fi
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://'$localbuild'.archive.ubuntu.com/#' /etc/apt/sources.list; fi
ENV DEBIAN_FRONTEND=noninteractive
# && add-apt-repository ppa:fcwu-tw/apps x11vnc
@ -55,29 +55,13 @@ RUN apt-get update \
################################################################################
# builder
################################################################################
FROM ubuntu:16.04 as builder
ARG localbuild
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://'$localbuild'tw.archive.ubuntu.com/#' /etc/apt/sources.list; fi
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
FROM node:8-alpine as builder
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& npm run build
&& yarn install \
&& yarn build
################################################################################

View file

@ -8,7 +8,7 @@ FROM arm32v7/ubuntu:18.04 as system
COPY --from=amd64 /usr/bin/qemu-arm-static /usr/bin/
ARG localbuild
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://tw.archive.ubuntu.com/#' /etc/apt/sources.list; fi
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://'$localbuild'.archive.ubuntu.com/#' /etc/apt/sources.list; fi
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
@ -25,7 +25,7 @@ RUN apt update \
# install debs error if combine together
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
lxde xvfb x11vnc \
lxqt openbox xvfb x11vnc \
firefox chromium-browser \
ttf-ubuntu-font-family ttf-wqy-zenhei \
&& apt autoclean -y \
@ -66,29 +66,19 @@ RUN apt-get update \
################################################################################
# builder
################################################################################
FROM ubuntu:18.04 as builder
ARG localbuild
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://tw.archive.ubuntu.com/#' /etc/apt/sources.list; fi
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
FROM node:8-alpine as builder
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& npm run build
&& yarn run build
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn install \
&& yarn build
################################################################################