← Back to issue list

Priming files into /lib breaks system binaries in the final image

View original Github issue

Metadata

Project
rockcraft
Number
#137
Type
issue
State
open
Author
tigarmo
Labels
Created
2022-11-03 13:38:05+00:00
Updated
2022-11-18 20:48:37+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

For the following `rockcraft.yaml`, the `files/` directory contains just an empty `file.txt`: ```yaml name: broken-image summary: summary description: description version: "0.0.1" license: Apache-2.0 base: ubuntu:22.04 platforms: amd64: parts: p1: plugin: dump source: files organize: file.txt: /lib/file.txt ``` After building and loading the ROCK into docker with skopeo, the binaries inside the container are broken: ```bash $ docker run -it broken-image bash exec /usr/bin/bash: no such file or directory ``` -------------------------------- From a little testing, I think the issue is the interaction between the base image layer and the new layer created for the parts. In `ubuntu:22.04`, `/lib` is a symlink to `/usr/lib`. The layer created for the parts' files has a `/lib/file.txt` and this is breaking the symlink; the "final" filesystem used in the containers has a regular `/lib` dir that is *not* a symlink, and only contains `file.txt`. Thus the binaries that link against `/lib` are now broken because the dependencies cannot be resolved anymore. This example is simple but the bug probably affects many plugins; in particular the `python` plugin breaks because it writes the `site-packages` in `/lib`.

Evaluation history

No evaluation history available.