Skip to content

apt-get install inn2 fails on Docker #311

@cclauss

Description

@cclauss

The apt-get install inn2 script very helpfully creates a default inn.conf file but that file causes hostname errors at Docker built-time. Could that script be modified to succeed when the hostname command returns buildkitsandbox?

Related to:

Using the Dockerfile

# FROM debian:bookworm
FROM ubuntu:24.04
# `hostname` at Docker built-time returns 'buildkitsandbox' on both Debian and Ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq && apt-get install --yes inn2
CMD ["systemctl", "status", "inn2"]

% docker build --no-cache --progress plain .

Setting up inn2 (2.7.2~20240212-1build3) ...
innconfval: hostname does not resolve or domain not set in inn.conf
innconfval: the FQDN of the server contains invalid characters not suitable for Message-IDs
dpkg: error processing package inn2 (--configure):
installed inn2 package post-installation script subprocess returned error exit status 1

Following the example from #310, I have tried to add the following modifications without success:

ENV INN_HOSTNAME=localhost.localdomain
# ENV INN_HOSTNAME=localhost.example.com
RUN echo "#!/bin/bash\n echo ${INN_HOSTNAME}" > /usr/bin/hostname && \
    echo "${INN_HOSTNAME}" > /etc/hostname && \
    hostname && \
    cat /etc/hostname && \
    apt-get update -qq && apt-get install --yes inn2

@ewxrjk
@rfc1036

Metadata

Metadata

Assignees

Labels

C: generalRelated to several componentsP: mediumMedium priorityenhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions