push docker image to container packages failed: failed commit on ref "index-sha256:.....": unexpected status: 404 Not Found #11570

Closed
opened 2025-11-02 09:41:21 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @vicalloy on GitHub (Aug 31, 2023).

Description

system: MacOS 13.4.1 (c)
docker desktop: 4.19.0 (106363)
- Enable: Settings -> Features in development -> Use contained for pulling and storing images

DOCKER_BUILDKIT=1 docker buildx build \
	-f Dockerfile-$(name) \
	--platform linux/arm/v7,linux/arm64 \
	-t sf/$(name):$(tag) .
REPOSITORY                      TAG               IMAGE ID       CREATED              SIZE
git.sf.tech/sf/python   3.10              c52d2cefc53d   About a minute ago   2.09GB
git.sf.tech/sf/python   3.10              c52d2cefc53d   About a minute ago   2.45GB
> docker push git.shifei.tech/shifei/python:3.10
....
c52d2cefc53d: Pushing [==================================================>]     708B/708B
da67d742d02b: Pushed 
.....
failed commit on ref "index-sha256:.....": unexpected status: 404 Not Found

Gitea Version

1.20.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Linux version 4.4.302+

How are you running Gitea?

version: "3.6"
services:
  gitea:
    container_name: gitea
    image: gitea/gitea:${GITEA_VERSION:-1.20}
    restart: unless-stopped
    environment:
      # https://docs.gitea.io/en-us/install-with-docker/#environments-variables
      - USER_UID=1026
      - USER_GID=100
      - ...
    ports:
      - "3000:3000"
      - "2222:22"
    networks:
      - gitea
    volumes:
      - ./data/gitea:/data
    depends_on:
      - postgres
  postgres:
    image: postgres:${POSTGRES_VERSION:-13}
    restart: always
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=gitea
      - POSTGRES_DB=gitea
    networks:
      - gitea
    volumes:
      - ./data/postgres:/var/lib/postgresql/data

networks:
  gitea:

Database

None

Originally created by @vicalloy on GitHub (Aug 31, 2023). ### Description system: MacOS 13.4.1 (c) docker desktop: 4.19.0 (106363) - Enable: Settings -> Features in development -> Use contained for pulling and storing images ``` DOCKER_BUILDKIT=1 docker buildx build \ -f Dockerfile-$(name) \ --platform linux/arm/v7,linux/arm64 \ -t sf/$(name):$(tag) . ``` ``` REPOSITORY TAG IMAGE ID CREATED SIZE git.sf.tech/sf/python 3.10 c52d2cefc53d About a minute ago 2.09GB git.sf.tech/sf/python 3.10 c52d2cefc53d About a minute ago 2.45GB ``` ``` > docker push git.shifei.tech/shifei/python:3.10 .... c52d2cefc53d: Pushing [==================================================>] 708B/708B da67d742d02b: Pushed ..... failed commit on ref "index-sha256:.....": unexpected status: 404 Not Found ``` ### Gitea Version 1.20.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Linux version 4.4.302+ ### How are you running Gitea? ``` version: "3.6" services: gitea: container_name: gitea image: gitea/gitea:${GITEA_VERSION:-1.20} restart: unless-stopped environment: # https://docs.gitea.io/en-us/install-with-docker/#environments-variables - USER_UID=1026 - USER_GID=100 - ... ports: - "3000:3000" - "2222:22" networks: - gitea volumes: - ./data/gitea:/data depends_on: - postgres postgres: image: postgres:${POSTGRES_VERSION:-13} restart: always environment: - POSTGRES_USER=gitea - POSTGRES_PASSWORD=gitea - POSTGRES_DB=gitea networks: - gitea volumes: - ./data/postgres:/var/lib/postgresql/data networks: gitea: ``` ### Database None
GiteaMirror added the topic/packagesissue/confirmedtype/bug labels 2025-11-02 09:41:21 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Aug 31, 2023):

Duplicate of #25893?

@KN4CK3R commented on GitHub (Aug 31, 2023): Duplicate of #25893?
Author
Owner

@vicalloy commented on GitHub (Sep 1, 2023):

Duplicate of #25893?

not the same problam. My problam is can't push the image to gitea.
You can try it with the follow scripts.
This script will retag the alpine images and push it to gitea.

retag.sh

BASE=alpine
MULTI_ARCH_TAG=latest
IMAGE=${BASE}:${MULTI_ARCH_TAG?}
SOURCES=$(docker manifest inspect ${IMAGE} | \
  jq -r '.manifests[].digest  | sub("^"; "'${BASE}'@")')

# push to docker.io can be success
# docker buildx imagetools create --dry-run -t vicalloy/alpine:latest $SOURCES
# docker buildx imagetools create -t vicalloy/alpine:latest $SOURCES

# push to gitea will fail. 
docker buildx imagetools create --dry-run -t git.sf.tech/sf/alpine:latest $SOURCES
docker buildx imagetools create -t git.sf.tech/sf/alpine:latest $SOURCES

Output

 => ERROR [internal] pushing git.sf.tech/sf/alpine:latest                                                                                                                                                                   17.4s
------
 > [internal] pushing git.sf.tech/sf/alpine:latest:
#0 0.001 copying sha256:5febc00b4d2a84af2a077bc34ea90659b6570110a54253f19c5dca8164b1dbf6 from docker.io/library/alpine@sha256:5febc00b4d2a84af2a077bc34ea90659b6570110a54253f19c5dca8164b1dbf6 to git.sf.tech/sf/alpine:latest
#0 0.001 copying sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 from docker.io/library/alpine@sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 to git.sf.tech/sf/alpine:latest
#0 0.001 copying sha256:f748290eb66ad6f938e25dd348acfb3527a422e280b7547b1cdfaf38d4492c4b from docker.io/library/alpine@sha256:f748290eb66ad6f938e25dd348acfb3527a422e280b7547b1cdfaf38d4492c4b to git.sf.tech/sf/alpine:latest
#0 0.001 copying sha256:16e86b2388774982fbdf230101a72201691b1f97cb0066c2099abf30dd7e6d59 from docker.io/library/alpine@sha256:16e86b2388774982fbdf230101a72201691b1f97cb0066c2099abf30dd7e6d59 to git.sf.tech/sf/alpine:latest
#0 0.001 copying sha256:b312e4b0e2c665d634602411fcb7c2699ba748c36f59324457bc17de485f36f6 from docker.io/library/alpine@sha256:b312e4b0e2c665d634602411fcb7c2699ba748c36f59324457bc17de485f36f6 to git.sf.tech/sf/alpine:latest
#0 0.001 copying sha256:1fd62556954250bac80d601a196bb7fd480ceba7c10e94dd8fd4c6d1c08783d5 from docker.io/library/alpine@sha256:1fd62556954250bac80d601a196bb7fd480ceba7c10e94dd8fd4c6d1c08783d5 to git.sf.tech/sf/alpine:latest
#0 0.001 copying sha256:c75ede79e457d6454bca6fc51967a247a4b9daff9f31197cfbef69b1a651cada from docker.io/library/alpine@sha256:c75ede79e457d6454bca6fc51967a247a4b9daff9f31197cfbef69b1a651cada to git.sf.tech/sf/alpine:latest
#0 17.43 pushing sha256:4574f3bce030b977c51d861bea49adf4855c44ab32d67ac5d19bc875b75c6755 to git.sf.tech/sf/alpine:latest
------
ERROR: failed commit on ref "index-sha256:4574f3bce030b977c51d861bea49adf4855c44ab32d67ac5d19bc875b75c6755": unexpected status: 404 Not Found

I can see the image in pkg, but only have one platform and size is not correct and can't pull it.

docker pull git.sf.tech/sf/alpine:latest
Error response from daemon: failed to resolve reference "git.sf.tech/sf/alpine:latest": failed to do request: Head "https://git.sf.tech/v2/sf/alpine/manifests/latest": EOF

pkg

@vicalloy commented on GitHub (Sep 1, 2023): > Duplicate of #25893? not the same problam. My problam is can't push the image to gitea. You can try it with the follow scripts. This script will retag the alpine images and push it to gitea. **retag.sh** ``` BASE=alpine MULTI_ARCH_TAG=latest IMAGE=${BASE}:${MULTI_ARCH_TAG?} SOURCES=$(docker manifest inspect ${IMAGE} | \ jq -r '.manifests[].digest | sub("^"; "'${BASE}'@")') # push to docker.io can be success # docker buildx imagetools create --dry-run -t vicalloy/alpine:latest $SOURCES # docker buildx imagetools create -t vicalloy/alpine:latest $SOURCES # push to gitea will fail. docker buildx imagetools create --dry-run -t git.sf.tech/sf/alpine:latest $SOURCES docker buildx imagetools create -t git.sf.tech/sf/alpine:latest $SOURCES ``` **Output** ``` => ERROR [internal] pushing git.sf.tech/sf/alpine:latest 17.4s ------ > [internal] pushing git.sf.tech/sf/alpine:latest: #0 0.001 copying sha256:5febc00b4d2a84af2a077bc34ea90659b6570110a54253f19c5dca8164b1dbf6 from docker.io/library/alpine@sha256:5febc00b4d2a84af2a077bc34ea90659b6570110a54253f19c5dca8164b1dbf6 to git.sf.tech/sf/alpine:latest #0 0.001 copying sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 from docker.io/library/alpine@sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 to git.sf.tech/sf/alpine:latest #0 0.001 copying sha256:f748290eb66ad6f938e25dd348acfb3527a422e280b7547b1cdfaf38d4492c4b from docker.io/library/alpine@sha256:f748290eb66ad6f938e25dd348acfb3527a422e280b7547b1cdfaf38d4492c4b to git.sf.tech/sf/alpine:latest #0 0.001 copying sha256:16e86b2388774982fbdf230101a72201691b1f97cb0066c2099abf30dd7e6d59 from docker.io/library/alpine@sha256:16e86b2388774982fbdf230101a72201691b1f97cb0066c2099abf30dd7e6d59 to git.sf.tech/sf/alpine:latest #0 0.001 copying sha256:b312e4b0e2c665d634602411fcb7c2699ba748c36f59324457bc17de485f36f6 from docker.io/library/alpine@sha256:b312e4b0e2c665d634602411fcb7c2699ba748c36f59324457bc17de485f36f6 to git.sf.tech/sf/alpine:latest #0 0.001 copying sha256:1fd62556954250bac80d601a196bb7fd480ceba7c10e94dd8fd4c6d1c08783d5 from docker.io/library/alpine@sha256:1fd62556954250bac80d601a196bb7fd480ceba7c10e94dd8fd4c6d1c08783d5 to git.sf.tech/sf/alpine:latest #0 0.001 copying sha256:c75ede79e457d6454bca6fc51967a247a4b9daff9f31197cfbef69b1a651cada from docker.io/library/alpine@sha256:c75ede79e457d6454bca6fc51967a247a4b9daff9f31197cfbef69b1a651cada to git.sf.tech/sf/alpine:latest #0 17.43 pushing sha256:4574f3bce030b977c51d861bea49adf4855c44ab32d67ac5d19bc875b75c6755 to git.sf.tech/sf/alpine:latest ------ ERROR: failed commit on ref "index-sha256:4574f3bce030b977c51d861bea49adf4855c44ab32d67ac5d19bc875b75c6755": unexpected status: 404 Not Found ``` I can see the image in pkg, but only have one platform and size is not correct and can't pull it. ``` docker pull git.sf.tech/sf/alpine:latest Error response from daemon: failed to resolve reference "git.sf.tech/sf/alpine:latest": failed to do request: Head "https://git.sf.tech/v2/sf/alpine/manifests/latest": EOF ``` ![pkg](https://github.com/go-gitea/gitea/assets/43507/9afbd876-6af6-4c09-aaf9-860774bbc6de)
Author
Owner

@Photograaf16 commented on GitHub (Jul 1, 2024):

same issue

@Photograaf16 commented on GitHub (Jul 1, 2024): same issue
Author
Owner

@skywalker282 commented on GitHub (Sep 27, 2024):

Same issue

@skywalker282 commented on GitHub (Sep 27, 2024): Same issue
Author
Owner

@wxiaoguang commented on GitHub (Jan 8, 2025):

Could you try 1.23-nightly? I think the problem might have been fixed there.

@wxiaoguang commented on GitHub (Jan 8, 2025): ~~Could you try 1.23-nightly? I think the problem might have been fixed there.~~
Author
Owner

@muefabian commented on GitHub (Jan 10, 2025):

Could you try 1.23-nightly? I think the problem might have been fixed there.

I'm not OP, but I have the same issue. Tried it with 1.23.1 but still the same.

@muefabian commented on GitHub (Jan 10, 2025): > Could you try 1.23-nightly? I think the problem might have been fixed there. I'm not OP, but I have the same issue. Tried it with 1.23.1 but still the same.
Author
Owner

@tiran133 commented on GitHub (Feb 13, 2025):

Any update on this. I have the same issue

@tiran133 commented on GitHub (Feb 13, 2025): Any update on this. I have the same issue
Author
Owner

@lunny commented on GitHub (Mar 2, 2025):

Could you give an example docker images links here so we can reproduce it?

@lunny commented on GitHub (Mar 2, 2025): Could you give an example docker images links here so we can reproduce it?
Author
Owner

@wxiaoguang commented on GitHub (Jul 1, 2025):

I think the problem should have been fixed on main branch, feel free to try the nightly build.

The script in https://github.com/go-gitea/gitea/issues/26839#issuecomment-1702000327 runs well on my side.

If there is still any problem, feel free to reopen and/or provide some reproducible steps.

Thank you all.

@wxiaoguang commented on GitHub (Jul 1, 2025): I think the problem should have been fixed on main branch, feel free to try the nightly build. * https://dl.gitea.com/gitea/main-nightly/ * https://hub.docker.com/r/gitea/gitea/tags?name=nightly The script in https://github.com/go-gitea/gitea/issues/26839#issuecomment-1702000327 runs well on my side. If there is still any problem, feel free to reopen and/or provide some reproducible steps. Thank you all.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11570