diff --git a/.github/workflows/build-samples.yml b/.github/workflows/build-samples.yml index 080126530..d6ddc2627 100644 --- a/.github/workflows/build-samples.yml +++ b/.github/workflows/build-samples.yml @@ -89,8 +89,8 @@ jobs: if [ -f ${build_script} ]; then ${build_script} ./apko else - ./apko build ${cfg} ${name}:build /tmp/${name}.tar --arch amd64 - ./apko build --offline ${cfg} ${name}:build /tmp/${name}.tar --arch amd64 + ./apko build ${cfg} ${name}:build /tmp/${name}.tar + ./apko build --offline ${cfg} ${name}:build /tmp/${name}.tar fi done diff --git a/examples/alpine-base.yaml b/examples/alpine-base.yaml index 88ab16a26..3fa82b471 100644 --- a/examples/alpine-base.yaml +++ b/examples/alpine-base.yaml @@ -12,3 +12,4 @@ environment: archs: - amd64 + - arm64 diff --git a/pkg/apk/apk/cache.go b/pkg/apk/apk/cache.go index 78ce1097a..74e26e559 100644 --- a/pkg/apk/apk/cache.go +++ b/pkg/apk/apk/cache.go @@ -368,6 +368,10 @@ func cacheDirFromFile(cacheFile string) string { return filepath.Join(filepath.Dir(cacheFile), "APKINDEX") } + if strings.HasSuffix(cacheFile, ".rsa.pub") { + return filepath.Join(filepath.Dir(cacheFile), filepath.Base(cacheFile)) + } + return filepath.Dir(cacheFile) } @@ -381,6 +385,11 @@ func cacheFileFromEtag(cacheFile, etag string) (string, error) { ext = ".tar.gz" } + // Keep all the rsa.pub files under subdirectory named by full filename. + if strings.HasSuffix(cacheFile, ".rsa.pub") { + cacheDir = filepath.Join(cacheDir, filepath.Base(cacheFile)) + } + absPath, err := filepath.Abs(filepath.Join(cacheDir, etag+ext)) if err != nil { return "", err