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.
2
Answers
Just to add to the answer from @RickRacklow, and to bring out some of the info in the comments, it seems that if your image is based on
node:18.15.0
, which shows asDebian GNU/Linux 11 (bullseye)
inside the resulting container, then all packages are frompackages.debian.org
(or some mirror of that). And when based onubuntu:22.10
then all packages come frompackages.ubuntu.com
(or some mirror of that).Hence why you might need to use a different package name in a Dockerfile based on
node:18.15.0
vs one based onubuntu:22.10
, should there be a discrepancy in the naming used in these two repositories.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 calledchromium browser
, hence if you try to installchromium
here, it’s not available.You can find this out via the package search for debian and ubuntu