chainguard-dev / apko

Build OCI images from APK packages directly without Dockerfile
https://apko.dev
Apache License 2.0
1.21k stars 125 forks source link

How to provide duplicate (but older) package version? #1377

Open ckoehler opened 3 weeks ago

ckoehler commented 3 weeks ago

I have a custom build of libpcap, packaged as libpcap-1.9.1-r0. But when I specify this in a build, it still conflicts with the Wolfi version:

solving "so:libpcap.so.1" constraint:   libpcap-1.10.3-r0.apk disqualified because libpcap-1.9.1-r0.apk already provides so:libpcap.so.1
  libpcap-1.10.4-r0.apk disqualified because libpcap-1.9.1-r0.apk already provides so:libpcap.so.1
  libpcap-1.10.4-r1.apk disqualified because libpcap-1.9.1-r0.apk already provides so:libpcap.so.1
  libpcap-1.10.4-r2.apk disqualified because libpcap-1.9.1-r0.apk already provides so:libpcap.so.1
  libpcap-1.10.4-r3.apk disqualified because libpcap-1.9.1-r0.apk already provides so:libpcap.so.1
  libpcap-1.10.5-r0.apk disqualified because libpcap-1.9.1-r0.apk already provides so:libpcap.so.1

I tried specifying the exact version, but still get an error:

solving "so:libpcap.so.1" constraint:   libpcap-1.10.3-r0.apk disqualified because "1.10.3-r0" does not satisfy "libpcap=1.9.1-r0@local"
  libpcap-1.10.4-r0.apk disqualified because "1.10.4-r0" does not satisfy "libpcap=1.9.1-r0@local"
  libpcap-1.10.4-r1.apk disqualified because "1.10.4-r1" does not satisfy "libpcap=1.9.1-r0@local"
  libpcap-1.10.4-r2.apk disqualified because "1.10.4-r2" does not satisfy "libpcap=1.9.1-r0@local"
  libpcap-1.10.4-r3.apk disqualified because "1.10.4-r3" does not satisfy "libpcap=1.9.1-r0@local"
  libpcap-1.10.5-r0.apk disqualified because "1.10.5-r0" does not satisfy "libpcap=1.9.1-r0@local"

This is run from Melange; the relevant parts of the config are:

environment:
  contents:
    keyring:
      - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
    repositories:
      - '@local /sensor-pfring/packages/'
      - https://packages.wolfi.dev/os
    packages: 
      # snip
      - libpcap=1.9.1-r0@local

The path to the local repo is the output of another Melange build that provides my version of libpcap.

Any idea on how to make this work?