← Back to issue list

apt package is not installed in the image.

View original Github issue

Metadata

Project
rockcraft
Number
#343
Type
issue
State
open
Author
Abuelodelanada
Labels
Created
Updated
Closed

Current evaluation

stage-packages (ca-certificates) missing from final rock image because the part's stage: filter restricts output to only bin/alertmanager and bin/amtool. Maintainer identified root cause; reporter acknowledged. No fix or label applied.

Suggested action: close not a bug

Reason: Maintainer sergiusens identified the root cause on 2023-08-14: the part's `stage: [bin/alertmanager, bin/amtool]` filter restricts staged files to only those two paths, so stage-packages files are excluded by design in craft-parts. The reporter acknowledged the explanation on 2024-02-16. The behavior is working as intended; the fix is a configuration change (use a separate nil-plugin part for stage-packages or remove the restrictive stage filter). No code change in rockcraft is required.

Impact: 25 Quick Win: 18.75 Staleness: 70 Complexity: 25 Confidence: 72 Support Request: 55

Issue body

### Bug Description apt package is not installed in the image. ### To Reproduce 1. Pack the following [rockcraft.yaml](https://github.com/canonical/alertmanager-rock/blob/main/rockcraft.yaml): 2. Copy the oci-image to docker: ```shell skopeo --insecure-policy copy oci-archive:alertmanager_0.25.0_amd64.rock docker-daemon:am:0.25.0 ``` 3. Run the container: ```shell docker run --rm am:0.25.0 ``` 4. Verify that the command `update-ca-certificates`, that it is installed with the package `ca-certificates` in the `stage-packages` section, is not present in the container: ```shell docker exec -it [NAME] whereis update-ca-certificates update-ca-certificates: ``` But, with this modification in `rockcraft.yaml`: ```diff @@ -31,8 +31,6 @@ parts: # Override until this issue is fixed: https://github.com/canonical/rockcraft/issues/21 build-snaps: - go/1.18/stable - stage-packages: - - ca-certificates override-build: | set -x REVISION=$(git rev-parse --short HEAD) @@ -57,3 +55,6 @@ parts: alertmanager.yml: etc/alertmanager/alertmanager.yml stage: - etc/alertmanager/alertmanager.yml + ca-certs: + plugin: nil + stage-packages: [ca-certificates] ``` The package **is** installed in the container: ```shell docker exec -it [NAME] whereis update-ca-certificates update-ca-certificates: /usr/sbin/update-ca-certificates /usr/share/man/man8/update-ca-certificates.8.gz ``` ### Environment Rockcraft: ```shell $ snap info rockcraft name: rockcraft summary: A craft like experience to create ROCKS publisher: Sergio Schvezov ⭐ (sergiusens) store-url: https://snapcraft.io/rockcraft license: GPL-3.0 description: | Rockcraft aims to take the same primitives used in Charmcraft and Snapcraft to create OCI images. commands: - rockcraft snap-id: 3mPIBn6L9IYLyBAZsaqjlnMk7huEtqlv tracking: latest/edge refresh-date: 7 days ago, at 21:22 -03 channels: latest/stable: – latest/candidate: – latest/beta: – latest/edge: 0+git.b72aed8 2023-08-04 (975) 86MB classic installed: 0+git.b72aed8 (975) 86MB classic ``` skopeo: ```shell $ skopeo --version skopeo version 1.4.1 ``` OS: ```shell $ cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.2 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.2 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy ``` Docker: ```shell $ docker version Client: Docker Engine - Community Version: 24.0.5 API version: 1.41 (downgraded from 1.43) Go version: go1.20.6 Git commit: ced0996 Built: Fri Jul 21 20:35:18 2023 OS/Arch: linux/amd64 Context: default Server: Engine: Version: 20.10.24 API version: 1.41 (minimum version 1.12) Go version: go1.20.4 Git commit: 5d6db84 Built: Wed May 24 23:31:22 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.6.20 GitCommit: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc: Version: 1.1.5 GitCommit: docker-init: Version: 0.19.0 GitCommit: de40ad0 ``` ### rockcraft.yaml ```shell name: alertmanager summary: Prometheus alertmanager in a ROCK. description: Alertmanager handles alerts sent by client applications such as the Prometheus server. version: "0.25.0" base: ubuntu:20.04 license: Apache-2.0 # Replicate the tree structure of the original image # https://github.com/prometheus/alertmanager/blob/main/Dockerfile # / # ├── bin # │ ├── alertmanager # │ └── amtool # └── etc # └── alertmanager # └── alertmanager.yml services: alertmanager: command: /bin/alertmanager --config.file=/etc/alertmanager/alertmanager.yml --storage.path=/alertmanager override: replace startup: enabled platforms: amd64: parts: alertmanager: plugin: go source: https://github.com/prometheus/alertmanager.git source-type: git source-tag: "v0.25.0" # Override until this issue is fixed: https://github.com/canonical/rockcraft/issues/21 build-snaps: - go/1.18/stable stage-packages: - ca-certificates override-build: | set -x REVISION=$(git rev-parse --short HEAD) BRANCH=$(git rev-parse --abbrev-ref HEAD) go build \ -ldflags="-X github.com/prometheus/common/version.Version=$(cat ./VERSION) -X github.com/prometheus/common/version.Revision=${REVISION} -X github.com/prometheus/common/version.Branch=${BRANCH} -X github.com/prometheus/common/version.BuildUser=$(whoami)@$(hostname) -X github.com/prometheus/common/version.BuildDate=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ -o bin/alertmanager \ ./cmd/alertmanager go build \ -ldflags="-X github.com/prometheus/common/version.Version=$(cat ./VERSION) -X github.com/prometheus/common/version.Revision=${REVISION} -X github.com/prometheus/common/version.Branch=${BRANCH} -X github.com/prometheus/common/version.BuildUser=$(whoami)@$(hostname) -X github.com/prometheus/common/version.BuildDate=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ -o bin/amtool \ ./cmd/amtool install -D -m755 bin/alertmanager ${CRAFT_PART_INSTALL}/bin/alertmanager install -D -m755 bin/amtool ${CRAFT_PART_INSTALL}/bin/amtool stage: - bin/alertmanager - bin/amtool default-config: plugin: dump source: . organize: alertmanager.yml: etc/alertmanager/alertmanager.yml stage: - etc/alertmanager/alertmanager.yml ``` ### Relevant log output ```shell . ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 18.75
Staleness: 70
Complexity: 25
Confidence: 72
Support Request: 55
close not a bug stage-packages (ca-certificates) missing from final rock image because the part's stage: filter restricts output to only bin/alertmanager and bin/amtool. Maintainer identified root cause; reporter acknowledged. No fix or label applied.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 10
Confidence: 90
Support Request: 80
close not a bug User reports ca-certificates missing from Rockcraft image despite stage-packages. Maintainer identified root cause: explicit stage: filter excludes unstaged files. Workaround provided. Inactive for 11 months.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 10
Confidence: 90
Support Request: 85
close not a bug User reported missing ca-certificates in a Rockcraft image. Maintainer clarified that explicit stage paths filter out other files, which is expected behavior. Issue acknowledged and inactive for over 10 months.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 15
Confidence: 85
Support Request: 85
close not a bug ca-certificates package missing from Rockcraft image despite stage-packages. Maintainer identified root cause as explicit stage paths filtering out package files. Inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 10
Confidence: 90
Support Request: 70
close not a bug Rockcraft OCI images drop ca-certificates files due to restrictive stage filters in rockcraft.yaml. Root cause identified. Internal ticket CRAFT-2498 created. Issue remains open with no recent activity.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.