Ubuntu images on Docker.io


When trying to install node.js into the default official Ubuntu image on Docker the other day I hit a dependency issue. Node.js needs rlwrap[1], and rlwrap is in the universe repository, which it turns out isn’t part of /etc/apt/sources.list for the 12.04 image:

deb http://archive.ubuntu.com/ubuntu precise main

Things worked using the ubuntu:quantal (== ununtu:12.10) image because that has an expanded sources.list that includes universe and multiverse – a much larger selection of available packages:

deb http://archive.ubuntu.com/ubuntu quantal main universe

It’s a total mystery to me why that difference should be there.

This specific issue can be fixed with a one line addition to the Dockerfile that adds the universe repository[2]:

RUN sed -i s/main/'main universe'/ /etc/apt/sources.list

I took a look at the stackbrew/ubuntu images, which it turns out have a much more complete and consistent set of sources.list (for all 4 versions that are presently available: 12.04, 12.10, 13.04 and 13.10):

deb http://archive.ubuntu.com/ubuntu version main universe
deb http://archive.ubuntu.com/ubuntu version-updates main
deb http://archive.ubuntu.com/ubuntu version-security main

Unfortunately this causes bad things to happen if you run ‘apt-get update && apt-get upgrade -y’:

dpkg: dependency problems prevent configuration of
 initramfs-tools depends on udev (>= 147~-5); however:
 Package udev is not configured yet.
dpkg: error processing initramfs-tools (--configure):
 dependency problems - leaving unconfigured

There’s really no need for initramfs stuff within a container – so the broader sources.list is causing the container to attempt to do unnatural things.


Dependency management in the current crop of Ubuntu images at hand for Docker.io is a bit of a mess at the moment. It’s not hard to straighten things out, but things that superficially look like they’re doing the right thing can come with unintended consequences that don’t fit well with the containerised approach.


[1] Here’s the error message:

Some packages could not be installed. This may mean that
you have requested an impossible situation or if you are
using the unstable distribution that some required
packages have not yet been created or been moved out of
The following information may help to resolve the
The following packages have unmet dependencies:
 nodejs : Depends: rlwrap but it is not installable

[2] Make sure there’s an ‘apt-get update’ afterwards

No Responses Yet to “Ubuntu images on Docker.io”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: