From c2ef22496a83b5821b554482a8ff2d6281e49d32 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 20 Sep 2021 13:22:42 +0200 Subject: [PATCH 1/4] refactor: switch to debian base image to avoid package incompatibilities --- Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index b49c5fa..2976e20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:lts-alpine3.14@sha256:7964eefba059e1536cca5c8da0181457b62d32f88a66fa44cb52734cd3b28c29 +FROM node:lts-bullseye-slim LABEL maintainer="Robert Kaussow " LABEL org.opencontainers.image.authors="Robert Kaussow " @@ -22,13 +22,12 @@ ENV LHCI_BASE_DIR=/drone/src \ ADD overlay/ / -RUN apk --update add --virtual .build-deps curl && \ - echo @edge http://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \ - echo @edge http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \ - apk update && \ - apk add --update --no-cache git chromium@edge harfbuzz@edge freetype@edge freetype-dev@edge jq && \ +RUN apt-get update && apt-get install -y git curl jq && \ curl -SsL -o /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" && \ chmod 755 /usr/local/bin/yq && \ + wget -qO - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | apt-key add - && \ + echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee "/etc/apt/sources.list.d/google.list" && \ + apt-get update && apt-get install --no-install-recommends -y google-chrome-stable && \ LHCI_VERSION="${LHCI_VERSION##v}" && \ LHCI_MAJOR="${LHCI_VERSION%%.*}" && \ if [ -z "${LHCI_MAJOR//[0-9]}" ] && [ -n "$LHCI_MAJOR" ]; then \ @@ -39,9 +38,8 @@ RUN apk --update add --virtual .build-deps curl && \ npm install -g @lhci/cli; \ fi && \ npm install -g lighthouse && \ - apk del .build-deps && \ - rm -rf /var/cache/apk/* && \ - rm -rf /tmp/* && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /tmp/* rm -rf /root/.cache/ USER root -- 2.24.4 From 0c3c2bdcb88d7fcb3715ff1fc7a82b9fea9755f2 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 20 Sep 2021 13:27:19 +0200 Subject: [PATCH 2/4] fix syntax --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2976e20..de62f0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN apt-get update && apt-get install -y git curl jq && \ fi && \ npm install -g lighthouse && \ rm -rf /var/lib/apt/lists/* && \ - rm -rf /tmp/* + rm -rf /tmp/* && \ rm -rf /root/.cache/ USER root -- 2.24.4 From 8027572145a082dc37347a768044f730fcc1151b Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 20 Sep 2021 13:29:06 +0200 Subject: [PATCH 3/4] add missing requirements --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index de62f0a..2ea5ef1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ ENV LHCI_BASE_DIR=/drone/src \ ADD overlay/ / -RUN apt-get update && apt-get install -y git curl jq && \ +RUN apt-get update && apt-get install -y git curl wget gnupg jq && \ curl -SsL -o /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" && \ chmod 755 /usr/local/bin/yq && \ wget -qO - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | apt-key add - && \ -- 2.24.4 From 5157910266449aa7a50a90537d3b8c61855b7ba1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 20 Sep 2021 14:17:38 +0200 Subject: [PATCH 4/4] cleanup --- Dockerfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ea5ef1..4255439 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,14 +29,8 @@ RUN apt-get update && apt-get install -y git curl wget gnupg jq && \ echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee "/etc/apt/sources.list.d/google.list" && \ apt-get update && apt-get install --no-install-recommends -y google-chrome-stable && \ LHCI_VERSION="${LHCI_VERSION##v}" && \ - LHCI_MAJOR="${LHCI_VERSION%%.*}" && \ - if [ -z "${LHCI_MAJOR//[0-9]}" ] && [ -n "$LHCI_MAJOR" ]; then \ - echo "Installing lhci version '$LHCI_VERSION' ..." && \ - npm install -g @lhci/cli@"$LHCI_VERSION"; \ - else \ - echo "Installing latest lhci ..." && \ - npm install -g @lhci/cli; \ - fi && \ + echo "Installing lhci version '$LHCI_VERSION' ..." && \ + npm install -g @lhci/cli@"$LHCI_VERSION"; \ npm install -g lighthouse && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /tmp/* && \ -- 2.24.4