generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
Description
Description
The .deb package installation fails during Docker image builds because the postinst script attempts to interact with systemd, which is not available in the Docker build context.
- Version affected:
1.300060.0b1248-1 - Last known working version:
1.300059.0b1207-1
The apparent cause is the addition of a postinst script to the .deb package.
Steps to Reproduce
Minimal reproducible Dockerfile:
ARG PLATFORM=linux/amd64
FROM --platform=$PLATFORM debian:bookworm-20250929-slim AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt --assume-yes --no-install-recommends install wget ca-certificates
RUN wget -nv https://amazoncloudwatch-agent.s3.amazonaws.com/debian/amd64/latest/amazon-cloudwatch-agent.deb
RUN dpkg -i amazon-cloudwatch-agent.debBuild command:
docker build -f Dockerfile .Expected Behavior
The .deb package should install successfully during Docker builds, similar to:
- How version 1.300059.0b1207-1 installed without issues
- How the
.rpmpackage can be installed withrpm -i --noposttrans(as shown in your official LocalStack AL2 Dockerfile)
Actual Behavior
The build fails with:
dpkg: error processing package amazon-cloudwatch-agent (--install):
installed amazon-cloudwatch-agent package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
amazon-cloudwatch-agent
Setting up amazon-cloudwatch-agent (1.300060.0b1248-1) ...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
unknown init system
Environment
- Host OS: macOS (Docker Desktop), Linux
- Docker build context: Ubuntu 24.04, Debian bookworm
- Package:
amazon-cloudwatch-agent.debfromhttps://amazoncloudwatch-agent.s3.amazonaws.com/debian/amd64/latest/ - First observed: ~October 10, 2025
Current Workaround
We're currently working around this by removing the postinst script before configuring the package:
RUN wget -nv https://amazoncloudwatch-agent.s3.amazonaws.com/debian/amd64/latest/amazon-cloudwatch-agent.deb \
&& dpkg --unpack ./amazon-cloudwatch-agent.deb \
&& rm -f /var/lib/dpkg/info/amazon-cloudwatch-agent.postinst \
&& dpkg --configure amazon-cloudwatch-agentThis mirrors the approach used in the RPM-based Dockerfiles with --noposttrans.
Notes
- Version 1.300059.0b1207-1 worked correctly in Docker builds
- Note: version 1.300060.0b1248-1 does not appear to have a corresponding GitHub release, which made it slightly more difficult to identify the cause.
- The official
.rpmpackage handles this case withrpm -i --noposttrans - The agent binaries install correctly and work when started manually in the container
- This is purely a Docker build-time issue; runtime operation is unaffected
particleflux, BitWire, davidmccahon, DawidKrysiak, jsmith-varicent and 11 more