Skip to content

Fix prepare.sh for building on Debian base images - #668

Open
emfox wants to merge 1 commit into
phusion:masterfrom
emfox:debian-trixie
Open

emfox wants to merge 1 commit into
phusion:masterfrom
emfox:debian-trixie

Conversation

@emfox

@emfox emfox commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Support building on Debian base images

make build BASE_IMAGE=debian:trixie ... currently fails. The script assumes
several things that hold for the official Ubuntu images but not for the
official Debian images. This PR makes image/prepare.sh work on both.

Problems

  1. python3 is never installed. /sbin/my_init is a Python 3 script
    (#!/usr/bin/python3 -u). The Ubuntu base images ship python3, the Debian
    ones do not, so the resulting image contains my_init but cannot execute
    it:
   exec /sbin/my_init: no such file or directory

(here refers to the missing interpreter, not the script.)

  1. software-properties-common is Ubuntu-only. It does not exist in the
    Debian Trixie repositories, so installation aborts the build:
   E: Unable to locate package software-properties-common
  1. lsb_release is not available on Debian. The lsb-release package is
    not part of the Debian base image, so the locale block fails to detect the
    distribution.

Changes

  • Install python3 after apt-get update.
  • Install software-properties-common only on Ubuntu.
  • Read the distribution from /etc/os-release instead of lsb_release. This
    is the same source the script already uses earlier in the file, so no new
    dependency is introduced.

Impact on Ubuntu

None. python3 is already present there, the software-properties-common
install still runs on Ubuntu, and /etc/os-release is part of both
distributions. Ubuntu builds behave exactly as before.

How I tested

Built the base image on debian:trixie running prepare.sh,
system_services.sh, utilities.sh and cleanup.sh:

$ make build BASE_IMAGE=debian:trixie NAME=phusion/baseimage-debian VERSION=trixie PLATFORM=amd64

PS: building failed without PLATFORM=amd64, that's another bug.

The official Debian images differ from the Ubuntu ones in ways that break
image/prepare.sh. Install python3 explicitly (my_init is a Python 3 script,
and the Debian images do not ship python3), restrict software-properties-common
to Ubuntu since Trixie does not provide it, and detect the distribution from
/etc/os-release instead of lsb_release, which is not installed on Debian.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant