when pushing multiple architecture and os of the same container package, the registry override image with the latest. #13553

Closed
opened 2025-11-02 10:45:50 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @ArKam on GitHub (Oct 1, 2024).

Description

Hi team,

I was pushing a container to the container registry as a feature test, when I found out that the registry doesn't support storing a container image for different architecture using the same image name.

If you build an image for both, linux/arm64 and linux/x86_64 or windows/arm64 and windows/x86_64 and try to push each resulting image to the container registry, the latest build will override the previous package.

With docker hub or quay or ghcr, you can have the same URL: forge.domain.tld/owner/package:version that deliver container version depending on the client spec (arm/x86_64) in here, from my understanding and test so far, I'll have to create an image with a name that specify <image_name>-arm64 or <image_name>-x86_64.

Gitea Version

1.22.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

provided by gitea/gitea:1.22.2

Operating System

linux

How are you running Gitea?

Using kubernetes to deploy gitea/gitea:1.22.2 release.

Database

PostgreSQL

Originally created by @ArKam on GitHub (Oct 1, 2024). ### Description Hi team, I was pushing a container to the container registry as a feature test, when I found out that the registry doesn't support storing a container image for different architecture using the same image name. If you build an image for both, linux/arm64 and linux/x86_64 or windows/arm64 and windows/x86_64 and try to push each resulting image to the container registry, the latest build will override the previous package. With docker hub or quay or ghcr, you can have the same URL: forge.domain.tld/owner/package:version that deliver container version depending on the client spec (arm/x86_64) in here, from my understanding and test so far, I'll have to create an image with a name that specify <image_name>-arm64 or <image_name>-x86_64. ### Gitea Version 1.22.2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version provided by gitea/gitea:1.22.2 ### Operating System linux ### How are you running Gitea? Using kubernetes to deploy gitea/gitea:1.22.2 release. ### Database PostgreSQL
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 10:45:50 -06:00
Author
Owner

@lunny commented on GitHub (Oct 8, 2024):

Can you describe your commands to upload the images or workflow file?

@lunny commented on GitHub (Oct 8, 2024): Can you describe your commands to upload the images or workflow file?
Author
Owner

@ArKam commented on GitHub (Oct 15, 2024):

Sure, I'm just using docker client to:

Docker build and push the image:
docker build --push --platform linux/arm64 -t <forge_url>/<organisation>/<image_name>:<image_tag> .
&
docker build --push --platform linux/amd64 -t <forge_url>/<organisation>/<image_name>:<image_tag> .

Although I didn't tried the all in one command such as:
docker build --push --platform linux/arm64,linux/amd64 -t <forge_url>/<organisation>/<image_name>:<image_tag> .
As I use architecture dedicated runners.

@ArKam commented on GitHub (Oct 15, 2024): Sure, I'm just using docker client to: Docker build and push the image: `docker build --push --platform linux/arm64 -t <forge_url>/<organisation>/<image_name>:<image_tag> .` & `docker build --push --platform linux/amd64 -t <forge_url>/<organisation>/<image_name>:<image_tag> .` Although I didn't tried the all in one command such as: `docker build --push --platform linux/arm64,linux/amd64 -t <forge_url>/<organisation>/<image_name>:<image_tag> .` As I use architecture dedicated runners.
Author
Owner

@hiifong commented on GitHub (Nov 20, 2024):

I guess you forgot to create a multi-arch manifest.
img_v3_02gr_2c08eb2a-4d6e-48dc-bc93-3ddb277d104g

docker manifest create \
    {gitea.domain}/{owner}/{image}:latest \
    {gitea.domain}/{owner}/{image}:amd64 \
    {gitea.domain}/{owner}/{image}:arm64

docker manifest push {gitea.domain}/{owner}/{image}:latest
@hiifong commented on GitHub (Nov 20, 2024): I guess you forgot to create a multi-arch manifest. ![img_v3_02gr_2c08eb2a-4d6e-48dc-bc93-3ddb277d104g](https://github.com/user-attachments/assets/9b6e5658-50ba-482b-bace-3841c81a38bc) ```shell docker manifest create \ {gitea.domain}/{owner}/{image}:latest \ {gitea.domain}/{owner}/{image}:amd64 \ {gitea.domain}/{owner}/{image}:arm64 docker manifest push {gitea.domain}/{owner}/{image}:latest ```
Author
Owner

@hiifong commented on GitHub (Nov 20, 2024):

Multi-architecture best practices: https://docs.docker.com/build/building/multi-platform/

@hiifong commented on GitHub (Nov 20, 2024): Multi-architecture best practices: https://docs.docker.com/build/building/multi-platform/
Author
Owner

@hiifong commented on GitHub (Nov 21, 2024):

I guess you forgot to create a multi-arch manifest. img_v3_02gr_2c08eb2a-4d6e-48dc-bc93-3ddb277d104g

docker manifest create \
    {gitea.domain}/{owner}/{image}:latest \
    {gitea.domain}/{owner}/{image}:amd64 \
    {gitea.domain}/{owner}/{image}:arm64

docker manifest push {gitea.domain}/{owner}/{image}:latest

image

However, this method will add some tags,it doesn't really solve your problem.Therefore, I recommend that you use docker buildx to create multi-architecture images.

docker buildx create --use --name {image}
docker buildx build --platform linux/amd64,linux/arm64 -t {gitea.domain}/{owner}/{image}:latest . --push --provenance false
@hiifong commented on GitHub (Nov 21, 2024): > I guess you forgot to create a multi-arch manifest. ![img_v3_02gr_2c08eb2a-4d6e-48dc-bc93-3ddb277d104g](https://private-user-images.githubusercontent.com/89133723/388200796-9b6e5658-50ba-482b-bace-3841c81a38bc.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzIxOTY5MjcsIm5iZiI6MTczMjE5NjYyNywicGF0aCI6Ii84OTEzMzcyMy8zODgyMDA3OTYtOWI2ZTU2NTgtNTBiYS00ODJiLWJhY2UtMzg0MWM4MWEzOGJjLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTIxVDEzNDM0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjOTIxNzJjMDlhMmY1ZTdmNDQyZWUxODhhNjk5NzYxOTg4Mzc3ZGUzZDI4ODVjMTQ0YmUwZmJiOTgxZTc4NjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.DY6aZzvhDxlNPyUCPRX3-Sbbp00uYMYUalpxUUI5hBo) > > ```shell > docker manifest create \ > {gitea.domain}/{owner}/{image}:latest \ > {gitea.domain}/{owner}/{image}:amd64 \ > {gitea.domain}/{owner}/{image}:arm64 > > docker manifest push {gitea.domain}/{owner}/{image}:latest > ``` ![image](https://github.com/user-attachments/assets/d97c5c8a-b8f1-4fff-bef5-96752233614c) However, this method will add some tags,it doesn't really solve your problem.Therefore, I recommend that you use docker buildx to create multi-architecture images. ```bash docker buildx create --use --name {image} docker buildx build --platform linux/amd64,linux/arm64 -t {gitea.domain}/{owner}/{image}:latest . --push --provenance false ```
Author
Owner

@ArKam commented on GitHub (Dec 12, 2024):

Aaaaah, you indeed may be right!
I'll test that but I'm pretty sure you get a point! thanks a lot!

@ArKam commented on GitHub (Dec 12, 2024): Aaaaah, you indeed may be right! I'll test that but I'm pretty sure you get a point! thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13553