Skip to content

Docker build fails #278

@jtreitz

Description

@jtreitz
5.380 E: Unable to locate package google-chrome-stable
------
Dockerfile:10
--------------------
   9 |     #
  10 | >>> RUN apt-get update \
  11 | >>>   && apt-get install -y wget gnupg \
  12 | >>>   && wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
  13 | >>>   && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
  14 | >>>   && apt-get update \
  15 | >>>   && apt-get install -y --no-install-recommends \
  16 | >>>     libxss1 \
  17 | >>>     google-chrome-stable \
  18 | >>>     fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
  19 | >>>   && rm -rf /var/lib/apt/lists/*

Potential fix (I cannot create PRs here):

Author: Johannes Treitz <jotreitz@gmail.com>
Date:   Mon May 19 10:49:25 2025 +0200

    Explicitly use linux/amd64 platform, otherwise Google Chrome cannot be installed
    Didn't work on my Apple-silicon Mac otherwise

diff --git a/Dockerfile b/Dockerfile
index f61f797..8fecf73 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:22-bullseye-slim
+FROM --platform=linux/amd64 node:22-bullseye-slim
 
 # Install dependencies and Google Chrome
 # Also install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
diff --git a/README.md b/README.md
index 20b48ed..f6b3d06 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ To try out locally:
 
 ```shell
 docker build -t pdf-renderer .
-docker run --name pdf-renderer -d -p 5017:5017 pdf-renderer
+docker run --platform linux/amd64 --name pdf-renderer -d -p 5017:5017 pdf-renderer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions