chainguard-dev / apko

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

initializing apk: failed to fixate apk world: exit status 99 #229

Open tuananh-finx opened 2 years ago

tuananh-finx commented 2 years ago

i'm trying to build image for arm64. amd64 would build fine but if i add arm64, i will get this

Error: failed to build layer image for "arm64": initializing apk: failed to fixate apk world: exit status 99
2022/06/14 03:50:08 error during command execution: failed to build layer image for "arm64": initializing apk: failed to fixate apk world: exit status 99

i have this

contents:
  repositories:
    - https://dl-cdn.alpinelinux.org/alpine/edge/main
    - https://dl-cdn.alpinelinux.org/alpine/edge/community
    - '@local /github/workspace/packages'
  packages:
    - alpine-baselayout-data
    - ca-certificates-bundle
    - git
    - my-package@local

entrypoint:
  command: /bin/sh

archs:
  - amd64
  - arm64

accounts:
  groups:
    - groupname: nonroot
      gid: 65532
  users:
    - username: nonroot
      uid: 65532
  run-as: 65532

and use this github actions

- uses: chainguard-dev/actions/apko-build@main
  id: apko
  with:
    tag: ghcr.io/${{ github.repository }}:latest
    keyring-append: /github/workspace/melange.rsa.pub
    source-date-epoch: ${{ steps.snapshot-date.outputs.epoch }}

i also add arm64 and amd64 to melange-build step

kaniini commented 2 years ago

Do you have a full build log? The apk error will be printed before that "failed to fixate" error.

tuananh-finx commented 2 years ago

right now, i'm getting a different error

Error: failed to build package: unable to populate workspace: open /home/runner/work/apko-helm-image-demo/apko-helm-image-demo/workspace/x86_64/.git/objects/2a/d0b165ee4e0887380f0fb1bb9039111a3bd6f6: permission denied
2022/06/15 14:27:02 error during command execution: failed to build package: unable to populate workspace: open /home/runner/work/apko-helm-image-demo/apko-helm-image-demo/workspace/x86_64/.git/objects/2a/d0b165ee4e0887380f0fb1bb9039111a3bd6f6: permission denied

the full build log is here: https://github.com/tuananh/apko-helm-image-demo/runs/6901762211?check_suite_focus=true

the branch is here https://github.com/tuananh/apko-helm-image-demo/tree/test-arm64-build

kaniini commented 2 years ago

You might try the empty-workspace: true option on the action. Looks like there might be an issue with permissions when running in the github actions environment.

tuananh-finx commented 2 years ago

when using that, i got a slightly different error

Error: failed to build package: unable to run pipeline: exit status 1
[745](https://github.com/tuananh/apko-helm-image-demo/runs/6960237890?check_suite_focus=true#step:8:759)
2022/06/20 03:54:46 error during command execution: failed to build package: unable to run pipeline: exit status 1
[746](https://github.com/tuananh/apko-helm-image-demo/runs/6960237890?check_suite_focus=true#step:8:760)
Error: Process completed with exit code 1.
tuananh commented 2 years ago

@kaniini do you have a working example somewhere. maybe i can take a look and see if i do anything different.

jgillich commented 2 years ago

FWIW, I got this error and there wasn't any visible cause...until I called apko with --debug and found out that the local repo gets ignored when you don't use a signing key. Would be nice if that check could be disabled for local repos (if apk allows for that).

thegingerlab commented 1 year ago

@jgillich I have the same issue, however I can't find how to provide a signing key for a repo, would you care to share?

jgillich commented 1 year ago

@thegingerlab You have to generate one, check the melange cli. Then you provide it to apko with --append-key iirc