cleanup Dockerfile, merged apt runs -> saved ~90MB
Image size from 1.04GB to 952MB.
This commit is contained in:
parent
34393eec76
commit
c44d1641ea
1 changed files with 17 additions and 31 deletions
26
Dockerfile
26
Dockerfile
|
|
@ -1,34 +1,20 @@
|
||||||
# FROM mcr.microsoft.com/playwright:v1.20.0
|
# FROM mcr.microsoft.com/playwright:v1.20.0
|
||||||
|
# Partially from https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.focal
|
||||||
FROM ubuntu:focal
|
FROM ubuntu:focal
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Playwright
|
|
||||||
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
|
||||||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD true
|
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD true
|
||||||
|
|
||||||
# === INSTALL Node.js ===
|
# Install up-to-date node & npm, then deps for virtual screen & noVNC
|
||||||
# Taken from https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.focal
|
|
||||||
RUN apt-get update && \
|
|
||||||
# Install node16
|
|
||||||
apt-get install -y curl wget && \
|
|
||||||
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
|
||||||
apt-get install -y nodejs && \
|
|
||||||
# Feature-parity with node.js base images.
|
|
||||||
apt-get install -y --no-install-recommends git openssh-client && \
|
|
||||||
npm install -g yarn && \
|
|
||||||
# clean apt cache
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
# Create the pwuser
|
|
||||||
adduser pwuser
|
|
||||||
|
|
||||||
# === Install the base requirements to run and debug webdriver implementations ===
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y curl \
|
||||||
|
&& curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
|
||||||
|
&& apt-get install -y nodejs \
|
||||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||||
xvfb \
|
xvfb \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
x11vnc \
|
x11vnc \
|
||||||
curl \
|
|
||||||
tini \
|
tini \
|
||||||
novnc websockify \
|
novnc websockify \
|
||||||
dos2unix \
|
dos2unix \
|
||||||
|
|
@ -54,7 +40,7 @@ RUN npm install \
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Shell scripts
|
# Shell scripts
|
||||||
# On windows, git might be configured to check out dos/CRLF line endings, so we convert.
|
# On windows, git might be configured to check out dos/CRLF line endings, so we convert them for those people in case they want to build the image.
|
||||||
RUN dos2unix ./docker/*.sh
|
RUN dos2unix ./docker/*.sh
|
||||||
RUN mv ./docker/entrypoint.sh /usr/local/bin/entrypoint \
|
RUN mv ./docker/entrypoint.sh /usr/local/bin/entrypoint \
|
||||||
&& chmod +x /usr/local/bin/entrypoint
|
&& chmod +x /usr/local/bin/entrypoint
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue