Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR : E: Unable to locate package google-chrome-stable while building Docker image #876

Open
navnit28 opened this issue Feb 23, 2024 · 1 comment
Labels
issue: bug report A bug has been reported needs triage

Comments

@navnit28
Copy link

Error String
E: Unable to locate package google-chrome-stable
executor failed running [/bin/sh -c apt-get update && apt-get install gnupg wget -y && wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && apt-get update && apt-get install google-chrome-stable -y --no-install-recommends && rm -rf /var/lib/apt/lists/*]: exit code: 100

Background

The following is my package.json:
"puppeteer": "^22.2.0", "puppeteer-extra": "^3.3.6", "puppeteer-extra-plugin-adblocker": "^2.13.6", "puppeteer-extra-plugin-anonymize-ua": "^2.4.6", "puppeteer-extra-plugin-stealth": "^2.11.2",

DockerFile
`FROM node:20-buster-slim
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

ENV UV_THREADPOOL_SIZE 128;

COPY . /src

WORKDIR /src
ENV NEW_RELIC_NO_CONFIG_FILE=true
ENV NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true
ENV NEW_RELIC_LOG=stdout
ENV NEW_RELIC_APP_NAME=File-Processor

#RUN mkdir /usr/share/man/man1/

RUN apt-get update && \
apt-get install -y build-essential
wget
python3
make
gcc \
libc6-dev
openjdk-11-jre
git
openssh-client
calibre

RUN apt-get update && apt-get install gnupg wget -y &&
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg &&
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' &&
apt-get update &&
apt-get install google-chrome-stable -y --no-install-recommends &&
rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get install -y libreoffice

RUN npm pkg set scripts.prepare="echo no-prepare"
RUN npm install -production

EXPOSE 3000 3001

CMD npm run start`

Description
The docker build command is failing with this error for one of my projects .

Error Description
`> [5/8] RUN apt-get update && apt-get install gnupg wget -y && wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && apt-get update && apt-get install google-chrome-stable -y --no-install-recommends && rm -rf /var/lib/apt/lists/*:
#9 0.489 Hit:1 http://deb.debian.org/debian buster InRelease
#9 0.651 Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
#9 0.816 Hit:3 http://deb.debian.org/debian buster-updates InRelease
#9 0.897 Reading package lists...
#9 1.429 Reading package lists...
#9 1.812 Building dependency tree...
#9 1.898 Reading state information...
#9 1.986 gnupg is already the newest version (2.2.12-1+deb10u2).
#9 1.986 gnupg set to manually installed.
#9 1.986 wget is already the newest version (1.20.1-1.1).
#9 1.986 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#9 2.504 Hit:1 http://deb.debian.org/debian buster InRelease
#9 2.512 Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
#9 2.525 Hit:3 http://deb.debian.org/debian buster-updates InRelease
#9 2.724 Get:4 http://dl.google.com/linux/chrome/deb stable InRelease [1825 B]
#9 2.870 Get:5 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1078 B]
#9 2.881 Fetched 2903 B in 0s (7079 B/s)
#9 2.881 Reading package lists...
#9 3.370 Reading package lists...
#9 3.728 Building dependency tree...
#9 3.801 Reading state information...
#9 3.848 E: Unable to locate package google-chrome-stable

executor failed running [/bin/sh -c apt-get update && apt-get install gnupg wget -y && wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && apt-get update && apt-get install google-chrome-stable -y --no-install-recommends && rm -rf /var/lib/apt/lists/*]: exit code: 100`

Puppeteer version
22.2.0

@navnit28 navnit28 added issue: bug report A bug has been reported needs triage labels Feb 23, 2024
@alpoxdev
Copy link

google-chrome-stable issue is not this library, but i can help you.

# Install Chrome Stable when specified
RUN if [ -n "$CHROME_STABLE_VERSION" ]; then \
    wget -q -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_STABLE_VERSION}-1_amd64.deb && \
    apt install -y /tmp/chrome.deb &&\
    rm /tmp/chrome.deb; \
  elif [ "$USE_CHROME_STABLE" = "true" ]; then \
    cd /tmp &&\
    wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb &&\
    dpkg -i google-chrome-stable_current_amd64.deb;\
  fi

use this script for download google-chrome, and i recommend to see this library. (no ad)

https://github.com/browserless/browserless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug report A bug has been reported needs triage
Projects
None yet
Development

No branches or pull requests

2 participants