Skip to content

Error when using --publish with --extension on pack build #2559

@evo-jwueppin

Description

@evo-jwueppin

Summary

When using pack build with the --extension ... and the --publish flag, it fails with the following message: ERROR: failed to build: executing lifecycle: container start: Error response from daemon: unable to find user root: no matching entries in passwd file.


Reproduction

This issue is reproduced in the example repository: https://github.com/evo-jwueppin/buildpack-extension-example in the latest run of the workflow: https://github.com/evo-jwueppin/buildpack-extension-example/actions/runs/...

Steps
  1. Build the extension image:
    generate:
#!/usr/bin/env bash
set -eo pipefail

echo run with ${user_id}
# 1. GET ARGS
output_dir=$CNB_OUTPUT_DIR

# 2. GENERATE run.Dockerfile
cat >>"${output_dir}/run.Dockerfile" <<EOL
ARG base_image
FROM \${base_image}

USER root
RUN apt-get update && apt-get install -y rsync

ARG user_id

USER \${user_id}
EOL

extension.toml:

# Buildpack API version
api = "0.12"

# Extension ID and metadata
[extension]
id = "example-scope/buildpack-image-with-extension"
version = "1.0.0"
name = "Rsync Extension"
homepage = "https://github.com/evo-jwueppin/buildpack-extension-example"
description = "A simple extension that installs rsync on the runtime base image"

pack-cli:

pack extension package ghcr.io/evo-jwueppin/buildpack-extension:latest \
          --publish \
          --path ./rsync-extension \
          --format image \
          --target "linux/amd64"
  1. Build the run-image with the extension image
    pack-cli:
pack build ghcr.io/evo-jwueppin/buildpack-image-with-extension:latest \
          --extension ghcr.io/evo-jwueppin/buildpack-extension:latest \
          -B paketobuildpacks/builder-jammy-base:latest \
          --verbose \
          --clear-cache \
          --publish
Current behavior

When building the run-image with the extension an error occurs:
ERROR: failed to build: executing lifecycle: container start: Error response from daemon: unable to find user root: no matching entries in passwd file but when running the same command from Reproduction-Step 2. without the --publish flag everything works as expected and the image succesfully builds.

Expected behavior

The image building and publishing succesfully.


Possibly-Related

buildpacks/lifecycle#1504

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/triageIssue or PR that requires contributor attention.type/bugIssue that reports an unexpected behaviour.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions