Move docker images to ubuntu

This commit is contained in:
acalcutt 2022-10-01 00:00:58 -04:00
parent 38604c0a45
commit ead82a4117
3 changed files with 51 additions and 40 deletions

View file

@ -1,21 +1,17 @@
FROM node:16-bullseye AS builder FROM ubuntu:focal AS builder
RUN export DEBIAN_FRONTEND=noninteractive \ RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \ && apt-get -qq update \
&& apt-get -y --no-install-recommends install \ && apt-get -y --no-install-recommends install \
apt-transport-https \ ca-certificates \
curl \ wget \
unzip \
build-essential \
python \
libcairo2-dev \
libgles2-mesa-dev \
libgbm-dev \
libprotobuf-dev \
&& apt-get -y --purge autoremove \ && apt-get -y --purge autoremove \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash
RUN apt-get install -y nodejs
COPY . /usr/src/app COPY . /usr/src/app
ENV NODE_ENV="production" ENV NODE_ENV="production"
@ -23,29 +19,29 @@ ENV NODE_ENV="production"
RUN cd /usr/src/app && npm install --production RUN cd /usr/src/app && npm install --production
FROM node:16-bullseye-slim AS final FROM ubuntu:focal AS final
RUN groupadd -r node && useradd -r -g node node
RUN export DEBIAN_FRONTEND=noninteractive \ RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \ && apt-get -qq update \
&& apt-get -y --no-install-recommends install \ && apt-get -y --no-install-recommends install \
libgles2-mesa \ ca-certificates \
libegl1 \ wget \
pkg-config \
xvfb \ xvfb \
xauth \ libglfw3-dev \
libopengl0 \
libcurl4 \
curl \
libuv1-dev \ libuv1-dev \
libc6-dev \ libjpeg-turbo8 \
libcap2-bin \ libicu66 \
unzip \
libcurl4-openssl-dev \
&& apt-get -y --purge autoremove \ && apt-get -y --purge autoremove \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN curl http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb --output libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash
RUN apt install ./libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb RUN apt-get install -y nodejs
RUN curl http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb --output libicu66_66.1-2ubuntu2_amd64.deb
RUN apt install ./libicu66_66.1-2ubuntu2_amd64.deb
COPY --from=builder /usr/src/app /app COPY --from=builder /usr/src/app /app

View file

@ -1,4 +1,17 @@
FROM node:16-bullseye FROM ubuntu:focal
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \
&& apt-get -y --no-install-recommends install \
ca-certificates \
wget \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash
RUN apt-get install -y nodejs
RUN groupadd -r node && useradd -r -g node node
ENV NODE_ENV="production" ENV NODE_ENV="production"
ENV CHOKIDAR_USEPOLLING=1 ENV CHOKIDAR_USEPOLLING=1
@ -12,3 +25,4 @@ RUN mkdir -p /usr/src/app
COPY / /usr/src/app COPY / /usr/src/app
RUN cd /usr/src/app && npm install --production RUN cd /usr/src/app && npm install --production
RUN ["chmod", "+x", "/usr/src/app/docker-entrypoint.sh"] RUN ["chmod", "+x", "/usr/src/app/docker-entrypoint.sh"]
USER node:node

View file

@ -2,25 +2,25 @@
# Simply run "docker build -f Dockerfile_test ." # Simply run "docker build -f Dockerfile_test ."
# WARNING: sometimes it fails with a core dumped exception # WARNING: sometimes it fails with a core dumped exception
FROM node:16-bullseye FROM ubuntu:focal
RUN apt-get -qq update \ RUN apt-get -qq update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install \ && DEBIAN_FRONTEND=noninteractive apt-get -y install \
apt-transport-https \ ca-certificates \
curl \ wget \
unzip \ pkg-config \
build-essential \
python \
libcairo2-dev \
libgles2-mesa-dev \
libgbm-dev \
libllvm3.9 \
libprotobuf-dev \
libxxf86vm-dev \
libopengl0 \
xvfb \ xvfb \
libglfw3-dev \
libuv1-dev \
libjpeg-turbo8 \
libicu66 \
unzip \
libcurl4-openssl-dev \
&& apt-get clean && apt-get clean
RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash
RUN apt-get install -y nodejs
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
@ -31,5 +31,6 @@ ENV NODE_ENV="test"
COPY package.json . COPY package.json .
RUN npm install RUN npm install
COPY / . COPY . .
RUN ls
RUN xvfb-run --server-args="-screen 0 1024x768x24" npm test RUN xvfb-run --server-args="-screen 0 1024x768x24" npm test