go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.25k stars 5.5k forks source link

Using docker buildx to build a multi-architecture image and push it to Gitea results in two unknown architectures #32613

Open hiifong opened 5 hours ago

hiifong commented 5 hours ago

Description

as title, and unable to delete package normally

build log:

hiifong@rock-5b:~/.app/dockerfile$ docker buildx build --platform linux/amd64,linux/arm64 -t 192.168.5.112:3000/images/go-server:latest . --push
[+] Building 64.6s (20/20) FINISHED                                                          docker-container:go-server
 => [internal] booting buildkit                                                                                    6.2s
 => => pulling image moby/buildkit:buildx-stable-1                                                                 5.5s
 => => creating container buildx_buildkit_go-server0                                                               0.7s
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 401B                                                                               0.0s
 => [linux/arm64 internal] load metadata for docker.io/library/golang:alpine                                       5.5s
 => [linux/amd64 internal] load metadata for docker.io/library/alpine:latest                                       4.3s
 => [linux/arm64 internal] load metadata for docker.io/library/alpine:latest                                       4.5s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                      0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                      0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [linux/arm64 build 1/4] FROM docker.io/library/golang:alpine@sha256:c694a4d291a13a9f9d94933395673494fc2cc9d4  21.6s
 => => resolve docker.io/library/golang:alpine@sha256:c694a4d291a13a9f9d94933395673494fc2cc9d4777b85df3a7e70b3492  0.0s
 => => sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B                           0.4s
 => => sha256:be085c496fa3648c76be85bb025157a095ddcbfd306f9a423cce78e0698dd3e4 126B / 126B                         0.6s
 => => sha256:323003b0d8ad8001283c9881b96c87e9fa38fb378aa4de93c4defd3899f30d2a 70.67MB / 70.67MB                  13.7s
 => => sha256:d571ba9261b2ec97b6a5261bc2b5f8dd6b1cad7aa5ab454e38fdd9ab1cf45335 293.52kB / 293.52kB                 0.4s
 => => extracting sha256:d571ba9261b2ec97b6a5261bc2b5f8dd6b1cad7aa5ab454e38fdd9ab1cf45335                          0.2s
 => => extracting sha256:323003b0d8ad8001283c9881b96c87e9fa38fb378aa4de93c4defd3899f30d2a                          7.3s
 => => extracting sha256:be085c496fa3648c76be85bb025157a095ddcbfd306f9a423cce78e0698dd3e4                          0.0s
 => => extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1                          0.0s
 => [internal] load build context                                                                                  0.1s
 => => transferring context: 43.81kB                                                                               0.0s
 => [linux/amd64 stage-1 1/2] FROM docker.io/library/alpine:latest@sha256:1e42bbe2508154c9126d48c2b8a75420c35443  15.9s
 => => resolve docker.io/library/alpine:latest@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017  0.0s
 => => sha256:da9db072f522755cbeb85be2b3f84059b70571b229512f1571d9217b77e1087f 3.62MB / 3.62MB                    15.7s
 => => extracting sha256:da9db072f522755cbeb85be2b3f84059b70571b229512f1571d9217b77e1087f                          0.1s
 => [linux/arm64 stage-1 1/2] FROM docker.io/library/alpine:latest@sha256:1e42bbe2508154c9126d48c2b8a75420c354434  1.3s
 => => resolve docker.io/library/alpine:latest@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e01  52.6s
 => => sha256:9986a736f7d3d24bb01b0a560fa0f19c4b57e56c646e1f998941529d28710e6b 4.09MB / 4.09MB                     1.0s
 => => extracting sha256:9986a736f7d3d24bb01b0a560fa0f19c4b57e56c646e1f998941529d28710e6b                          0.2s
 => [linux/arm64->amd64 build 2/4] WORKDIR /app                                                                    0.5s
 => [linux/arm64->amd64 build 3/4] ADD buildme .                                                                   0.1s
 => [linux/arm64->amd64 build 4/4] RUN GOOS=linux GOARCH=amd64 go build -o server .                               28.3s
 => [linux/arm64 build 4/4] RUN GOOS=linux GOARCH=arm64 go build -o server .                                      29.0s
 => [linux/amd64 stage-1 2/2] COPY --from=build /app/server /server                                                0.1s
 => [linux/arm64 stage-1 2/2] COPY --from=build /app/server /server                                                0.0s
 => exporting to image                                                                                             1.2s
 => => exporting layers                                                                                            0.6s
 => => exporting manifest sha256:4dabbbeea03faa4a00cc22a944faaf929d3005563c8101d0ccfe1fcf693f11b2                  0.0s
 => => exporting config sha256:3800a8d002eecc82cd287de9ac0e8d9709bb1b2c3830832645b65c2fc15a4e5f                    0.0s
 => => exporting attestation manifest sha256:5fc85e345416206a620b318efab87c7d381501278272e0f51f7fe92f04166bdd      0.0s
 => => exporting manifest sha256:f3e2c5d3ecfc36e5c931f65591eb3898c0c84cb7fbc5be1d6a0631da5d007187                  0.0s
 => => exporting config sha256:8d0ba44a1e86ce401e3458166cebd74cb2103c6ba7f51b6ea0d5519669028daa                    0.0s
 => => exporting attestation manifest sha256:3e0c5a00d23349ece5a02964071b8b2b1b1ace7dc7406b62bc80fb1912bcc07e      0.0s
 => => exporting manifest list sha256:e26b5af5a841aa5d8f92ffbfad8f8a8fc38c609bc6b4263645bfb211a753a8ab             0.0s
 => => pushing layers                                                                                              0.4s
 => => pushing manifest for 192.168.5.112:3000/images/go-server:latest@sha256:e26b5af5a841aa5d8f92ffbfad8f8a8fc38  0.1s
 => [auth] *:: images/go-server:pull,push token for 192.168.5.112:3000

delete log:

2024/11/22 22:38:53 ...s/process/manager.go:188:Add() [T] Start 6740977d: POST: /images/-/packages/container/go-server/sha256:5fc85e345416206a620b318efab87c7d381501278272e0f51f7fe92f04166bdd/settings (request)
2024/11/22 22:38:53 ...eb/routing/logger.go:47:func1() [T] router: started   POST /images/-/packages/container/go-server/sha256:5fc85e345416206a620b318efab87c7d381501278272e0f51f7fe92f04166bdd/settings for [::1]:60526
2024/11/22 22:38:53 ...ices/auth/session.go:40:Verify() [T] Session Authorization: Found user[1]
2024/11/22 22:38:53 ...ices/auth/session.go:58:Verify() [T] Session Authorization: Logged in user <User 1:hiifong>
2024/11/22 22:38:53 ...packages/packages.go:482:RemovePackageVersion() [T] Deleting package: 4
2024/11/22 22:38:53 ...eb/routing/logger.go:102:func1() [I] router: completed POST /images/-/packages/container/go-server/sha256:5fc85e345416206a620b318efab87c7d381501278272e0f51f7fe92f04166bdd/settings for [::1]:60526, 303 See Other in 15.2ms @ user/package.go:428(user.PackageSettingsPost)
2024/11/22 22:38:53 ...s/process/manager.go:231:remove() [T] Done 6740977d: POST: /images/-/packages/container/go-server/sha256:5fc85e345416206a620b318efab87c7d381501278272e0f51f7fe92f04166bdd/settings
2024/11/22 22:38:53 ...s/process/manager.go:188:Add() [T] Start 6740977d-2: GET: /images/-/packages/container/go-server (request)
2024/11/22 22:38:53 ...eb/routing/logger.go:47:func1() [T] router: started   GET /images/-/packages/container/go-server for [::1]:60526
2024/11/22 22:38:53 ...ices/auth/session.go:40:Verify() [T] Session Authorization: Found user[1]
2024/11/22 22:38:53 ...ices/auth/session.go:58:Verify() [T] Session Authorization: Logged in user <User 1:hiifong>
2024/11/22 22:38:53 ...eb/routing/logger.go:102:func1() [I] router: completed GET /images/-/packages/container/go-server for [::1]:60526, 303 See Other in 5.9ms @ user/package.go:138(user.RedirectToLastVersion)
2024/11/22 22:38:53 ...s/process/manager.go:231:remove() [T] Done 6740977d-2: GET: /images/-/packages/container/go-server
2024/11/22 22:38:53 ...s/process/manager.go:188:Add() [T] Start 6740977d-3: GET: /images/-/packages/container/go-server/sha256:f3e2c5d3ecfc36e5c931f65591eb3898c0c84cb7fbc5be1d6a0631da5d007187 (request)
2024/11/22 22:38:53 ...eb/routing/logger.go:47:func1() [T] router: started   GET /images/-/packages/container/go-server/sha256:f3e2c5d3ecfc36e5c931f65591eb3898c0c84cb7fbc5be1d6a0631da5d007187 for [::1]:60526
2024/11/22 22:38:53 ...ices/auth/session.go:40:Verify() [T] Session Authorization: Found user[1]
2024/11/22 22:38:53 ...ices/auth/session.go:58:Verify() [T] Session Authorization: Logged in user <User 1:hiifong>
2024/11/22 22:38:53 .../context_response.go:70:HTML() [D] Template: package/view
2024/11/22 22:38:53 ...eb/routing/logger.go:102:func1() [I] router: completed GET /images/-/packages/container/go-server/sha256:f3e2c5d3ecfc36e5c931f65591eb3898c0c84cb7fbc5be1d6a0631da5d007187 for [::1]:60526, 200 OK in 8.4ms @ user/package.go:172(user.ViewPackageVersion)
2024/11/22 22:38:53 ...s/process/manager.go:231:remove() [T] Done 6740977d-3: GET: /images/-/packages/container/go-server/sha256:f3e2c5d3ecfc36e5c931f65591eb3898c0c84cb7fbc5be1d6a0631da5d007187

Gitea Version

main

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image image image

https://github.com/user-attachments/assets/06cca70a-c4d6-4c45-8876-7db0ae497757

Git Version

No response

Operating System

No response

How are you running Gitea?

run from source code, ./gitea web

Database

None