Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

download command produces wrong container names when using oci registry #29

Closed
katexochen opened this issue Jan 23, 2023 · 2 comments · Fixed by #83
Closed

download command produces wrong container names when using oci registry #29

katexochen opened this issue Jan 23, 2023 · 2 comments · Fixed by #83
Labels
bug Something isn't working

Comments

@katexochen
Copy link

I'm trying to archive packages in a container registry and download them afterwards with repro-get to then export them. The naming/urls of the downloaded packages seem to be wrong in the cache, and an export fails. If I pull the images with oras, they have the expected names.

Containerfile to get apk packages:

FROM alpine:3.17.1 as builder
ADD https://github.com/reproducible-containers/repro-get/releases/download/v0.3.0/repro-get-v0.3.0.linux-amd64 \
    /usr/bin/repro-get
RUN chmod +x /usr/bin/repro-get
RUN apk update && apk add bash
WORKDIR /out
RUN repro-get hash generate > /out/SHA256SUMS
RUN repro-get cache export /out/repository-apk

FROM scratch
COPY --from=builder /out .

Commands to get apks and push to registry:

DOCKER_BUILDKIT=1 docker build -o . -f ../Containerfile .
cd out/repository-apk
oras push ghcr.io/katexochen/apk-repo-test:latest *.apk

Trying to pull the image with repro-get:

$ repro-get \
    --provider=oci://ghcr.io/katexochen/apk-repo-test \
    --cache ./cache \
    --distro alpine \
    download SHA256SUMS-apk-amd64

WARN[0000] Distro driver "alpine" is experimental       
(001/080) gcompat-1.1.0-r0.apk Downloading from oci://ghcr.io/katexochen/apk-repo-test
33.04 KiB / 33.04 KiB [-----------------------------------] 100.00% 131.83 KiB/s
(002/080) libvirt-dev-8.9.0-r4.apk Downloading from oci://ghcr.io/katexochen/apk-repo-test
268.47 KiB / 268.47 KiB [---------------------------------] 100.00% 811.65 KiB/s
(003/080) libvirt-libs-8.9.0-r4.apk Downloading from oci://ghcr.io/katexochen/apk-repo-test
1.53 MiB / 1.53 MiB [---------------------------------------] 100.00% 3.65 MiB/s
(004/080) alpine-baselayout-3.4.0-r0.apk Downloading from oci://ghcr.io/katexochen/apk-repo-test
8.68 KiB / 8.68 KiB [--------------------------------------] 100.00% 36.65 KiB/s
(005/080) alpine-baselayout-data-3.4.0-r0.apk Downloading from oci://ghcr.io/katexochen/apk-repo-test
11.39 KiB / 11.39 KiB [------------------------------------] 100.00% 43.79 KiB/s
(006/080) alpine-keys-2.4-r1.apk Downloading from oci://ghcr.io/katexochen/apk-repo-test
13.05 KiB / 13.05 KiB [------------------------------------] 100.00% 53.96 KiB/s
...

$ repro-get \
    --cache ./cache \
    --distro alpine \
    cache export ./repository-apk/

ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
ERRO[0000] Avoiding to overwrite existing file "test/repository-apk/apk-repo-test" 
...

$ cat cache/urls/sha256/04f0a17f216e28f8d4f1351bb0dafb4798f39da6f8972d85c6da9dd118ed6ef7 
oci://ghcr.io/katexochen/apk-repo-test

$ cat cache/urls/sha256/0c083d8c3d2511e8387e487c83aaa429de5a76fbf0219404c3afde63b715d2a4 
oci://ghcr.io/katexochen/apk-repo-test
@AkihiroSuda AkihiroSuda added the bug Something isn't working label Jan 24, 2023
@AkihiroSuda
Copy link
Member

Fixed in v0.4.0: https://github.com/reproducible-containers/repro-get/releases/tag/v0.4.0
Sorry for the delay

@katexochen
Copy link
Author

Thanks a lot for the fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants