apko icon indicating copy to clipboard operation
apko copied to clipboard

Unable to mix local and remote repositories

Open kameshsampath opened this issue 2 years ago • 2 comments

Assuming I have a melange.yaml like ( trimmed for brevity)

  dependencies:
    runtime:
      - ca-certificates-bundle
      - busybox
      - alpine-keys
      - gcc
      - bash

environment:
  contents:
    keyring:
    repositories:
       - https://dl-cdn.alpinelinux.org/alpine/edge/main
       - https://dl-cdn.alpinelinux.org/alpine/edge/community
       - https://dl-cdn.alpinelinux.org/alpine/edge/testing
    packages:
      - alpine-keys
      - alpine-sdk 
      - busybox
      - build-base
      - lld
      - clang 
      - clang-dev 
      - linux-headers 
      - curl
      - wget
      - rustup
      - xz

Say it builds a package rust-zig-builder under $PROJECT_HOME/packages .

Then trying to build image with config,

archs:
- amd64
- arm64

contents:
  keyring:
    - melange.rsa.pub
  repositories:
    - https://dl-cdn.alpinelinux.org/alpine/edge/main
    - https://dl-cdn.alpinelinux.org/alpine/edge/community
    - '@local packages'
  packages:
    - rust-zig-builder@local

command: /bin/sh

The image build fails with error as

Feb 26 04:27:15.411 [INFO] loading config file: image.yaml
Feb 26 04:27:15.421 [INFO] [arch:x86_64] detected https://github.com/kameshsampath/rust-zig-builder@8d3111d48a56da8263497a35ff6eceb7625a62b9 as VCS URL
Feb 26 04:27:15.421 [INFO] [arch:x86_64] WARNING: ignoring archs in config, only building for current arch (amd64)
Feb 26 04:27:15.421 [INFO] [arch:x86_64] building image 'quay.io/kameshsampath/rust-zig-builder:latest'
Feb 26 04:27:15.421 [INFO] [arch:x86_64] build context:
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   working directory: /tmp/apko-2211297692
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   tarball path:
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   use proot: false
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   source date: 1970-01-01 00:00:00 +0000 UTC
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   Docker mediatypes: false
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   SBOM output path: /Users/kameshs/git/kameshsampath/rust-zig-builder/dist/rust-zig-builder
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   arch: x86_64
Feb 26 04:27:15.421 [INFO] [arch:x86_64] image configuration:
Feb 26 04:27:15.421 [INFO] [arch:x86_64]   contents:
Feb 26 04:27:15.421 [INFO] [arch:x86_64]     repositories: [https://dl-cdn.alpinelinux.org/alpine/edge/main https://dl-cdn.alpinelinux.org/alpine/edge/community @local packages]
Feb 26 04:27:15.421 [INFO] [arch:x86_64]     keyring:      [melange.rsa.pub]
Feb 26 04:27:15.421 [INFO] [arch:x86_64]     packages:     [rust-zig-builder@local]
Feb 26 04:27:15.421 [INFO] [arch:x86_64] doing pre-flight checks
Feb 26 04:27:15.421 [INFO] [arch:x86_64] building image fileystem in /tmp/apko-2211297692
Feb 26 04:27:15.421 [INFO] [arch:x86_64] initializing apk database
Feb 26 04:27:15.421 [INFO] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] running: /sbin/apk add --initdb --arch x86_64 --root /tmp/apko-2211297692
Feb 26 04:27:15.423 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] OK: 0 MiB in 0 packages
Feb 26 04:27:15.424 [INFO] [arch:x86_64] initializing apk repositories
Feb 26 04:27:15.424 [INFO] [arch:x86_64] initializing apk world
Feb 26 04:27:15.424 [INFO] [arch:x86_64] initializing apk keyring
Feb 26 04:27:15.424 [DEBUG] [arch:x86_64] installing key melange.rsa.pub
Feb 26 04:27:15.425 [INFO] [arch:x86_64] synchronizing with desired apk world
Feb 26 04:27:15.425 [INFO] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] running: /sbin/apk fix --root /tmp/apko-2211297692 --no-scripts --no-cache --update-cache --arch x86_64
Feb 26 04:27:15.428 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
Feb 26 04:27:15.990 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
Feb 26 04:27:15.991 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/edge/main: UNTRUSTED signature
Feb 26 04:27:16.452 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/edge/community: UNTRUSTED signature
Feb 26 04:27:16.459 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:] ERROR: unable to select packages:
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   alpine-keys (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[alpine-keys]
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   bash (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[bash]
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   busybox (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[busybox]
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   ca-certificates-bundle (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[ca-certificates-bundle]
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   gcc (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[gcc]
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   so:libc.musl-x86_64.so.1 (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[so:libc.musl-x86_64.so.1]
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]   so:libgcc_s.so.1 (no such package):
Feb 26 04:27:16.462 [DEBUG] [arch:x86_64] [cmd:apk] [use-proot:false] [use-qemu:]     required by: rust-zig-builder-0.0.1-r0[so:libgcc_s.so.1]
Error: failed to build layer image: initializing apk: failed to fixate apk world: exit status 8
2023/02/26 04:27:16 error during command execution: failed to build layer image: initializing apk: failed to fixate apk world: exit status 8

kameshsampath avatar Feb 26 '23 04:02 kameshsampath

CC: @imjasonh

kameshsampath avatar Feb 26 '23 04:02 kameshsampath

This will be fixed when melange switches to apko 0.7.1.

kaniini avatar Feb 27 '23 01:02 kaniini