Search code examples
dockerubuntudockerfilepuppeteerchromium

Different chromium packages for "FROM node:18.15.0" vs "FROM ubuntu:22.10"


I find that following Dockerfile builds fine (on Ubuntu 22.10), finding all the right packages:

FROM node:18.15.0

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
 && apt-get install -y --no-install-recommends \
       build-essential \
       chromium \
       chromium-sandbox \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

Obviously this is just an extract from the Dockerfile, there is more besides the above.

But when my Dockerfile is based on the following:

FROM ubuntu:22.10

... the same apt-get install step as above causes the build to fail, with the following error:

Package chromium is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  chromium-bsu
E: Package 'chromium' has no installation candidate
E: Unable to locate package chromium-sandbox

I am slightly confused about what packages are available for each case, and why. My guess is that the one based on node:18.15.0 is ultimately based on debian-11, which is what Ubuntu 20.10 is based on. And hence why the available chromium packages are different?

I'm really confused because there is apparently no chromium package available for Ubuntu at all, only chromium-browser... see here.

So is the node:18.15.0 build getting the package from here, where chromium is indeed available?

But according to that package listing, chromium is available for bookworm (used by Ubuntu 22.10) and bullseye (used by Ubuntu 20.10), so why can't I install chromium for my ubuntu:22.10 build?

Perhaps because the bookworm package is denoted as (testing) rather than (stable)?

If so, how can I use the bookworm (testing) package in my ubuntu:22.10 build?

Sorry if any of this sounds dumb, but it's really confusing for me and I'd like to understand the mechanics of it all, thanks.


Solution

  • While Ubuntu is being debian based, it doesn't use the exact same packages from the exact same repositories for all use cases. In this case there is a naming discrepancy between the debian and the Ubuntu packages: on debian the package is called chromium which is why everything works as expected on the debian based node image, but on Ubuntu the package is called chromium browser, hence if you try to install chromium here, it's not available.

    You can find this out via the package search for debian and ubuntu