[Bug]: `x86_64` based container using `amazonlinux:2027` cannot use `tar` for extracting archives

Aperta
#2,494 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
swift

Direzione di ricerca

The report gives a reproducible failure with emulated x86_64 Amazon Linux 2027 containers and a working arm64 comparison, but names no source files or tests. Start by reading the container run and architecture emulation entry points, then reproduce the tar extraction failure under the reported conditions. Done when the same extraction succeeds on x86_64 and the arm64 behavior remains working.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have done the following
  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
  • Launching a new x86 based container using container built from HEAD:
container run -it --arch amd64 --rm --name al2027 public.ecr.aws/amazonlinux/amazonlinux:2027 bash
  • After the container is launched, the following command will fail: (the command will download and install all recent updates using dnf then install gzip for gz extraction support, download the source archive of this repo to /tmp, and try to extract content)
bash-5.3# dnf update && dnf upgrade -y && dnf install -y gzip && pushd /tmp && curl --output container_src.tar.gz -fsSL https://github.com/apple/container/archive/refs/tags/1.7.1.tar.gz && tar xzvf container_src.tar.gz
Updating and loading repositories:
 Amazon Linux 2027 repository                                                                                                                          100% |   1.2 MiB/s |   2.7 MiB |  00m02s
Repositories loaded.
Nothing to do.
Updating and loading repositories:
Repositories loaded.
Nothing to do.
Updating and loading repositories:
Repositories loaded.
Package                                                          Arch           Version                                                          Repository                                Size
Installing:
 gzip                                                            x86_64         0:1.14-2.amzn2027                                                amazonlinux                          401.8 KiB

Transaction Summary:
 Installing:         1 package

Total size of inbound packages is 175 KiB. Need to download 175 KiB.
After this operation, 402 KiB extra will be used (install 402 KiB, remove 0 B).
[1/1] gzip-0:1.14-2.amzn2027.x86_64                                                                                                                    100% | 285.4 KiB/s | 175.3 KiB |  00m01s
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[1/1] Total                                                                                                                                            100% | 115.1 KiB/s | 175.3 KiB |  00m02s
Running transaction
[1/3] Verify package files                                                                                                                             100% |   1.0 KiB/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                                                                                                              100% | 200.0   B/s |   1.0   B |  00m00s
[3/3] Installing gzip-0:1.14-2.amzn2027.x86_64                                                                                                         100% |   7.5 MiB/s | 407.3 KiB |  00m00s
Complete!
/tmp /
container-1.7.1/
container-1.7.1/.claude-plugin/
/usr/sbin/tar: container-1.7.1/.claude-plugin: Cannot mkdir: Function not implemented
...
/usr/sbin/tar: container-1.7.1/skills/container/references/docker-migration.md: Cannot open: Function not implemented
/usr/sbin/tar: Exiting with failure status due to previous errors
  • arm64 based container won't run into this issue when running the same command in the container:
$ bin/container run -it --rm --name al2027 public.ecr.aws/amazonlinux/amazonlinux:2027 bash
bash-5.3# dnf update && dnf upgrade -y && dnf install -y gzip && pushd /tmp && curl --output container_src.tar.gz -fsSL https://github.com/apple/container/archive/refs/tags/1.7.1.tar.gz && tar xzvf container_src.tar.gz
Updating and loading repositories:
 Amazon Linux 2027 repository                                                                                                                          100% |   1.3 MiB/s |   2.7 MiB |  00m02s
Repositories loaded.
Nothing to do.
Updating and loading repositories:
Repositories loaded.
Nothing to do.
Updating and loading repositories:
Repositories loaded.
Package                                                          Arch            Version                                                          Repository                               Size
Installing:
 gzip                                                            aarch64         0:1.14-2.amzn2027                                                amazonlinux                         437.7 KiB

Transaction Summary:
 Installing:         1 package

Total size of inbound packages is 168 KiB. Need to download 168 KiB.
After this operation, 438 KiB extra will be used (install 438 KiB, remove 0 B).
[1/1] gzip-0:1.14-2.amzn2027.aarch64                                                                                                                   100% | 281.1 KiB/s | 168.4 KiB |  00m01s
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[1/1] Total                                                                                                                                            100% | 121.8 KiB/s | 168.4 KiB |  00m01s
Running transaction
[1/3] Verify package files                                                                                                                             100% |   1.0 KiB/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                                                                                                              100% | 250.0   B/s |   1.0   B |  00m00s
[3/3] Installing gzip-0:1.14-2.amzn2027.aarch64                                                                                                        100% |  14.9 MiB/s | 443.3 KiB |  00m00s
Complete!
/tmp /
container-1.7.1/
container-1.7.1/.claude-plugin/
....
container-1.7.1/skills/container/references/docker-migration.md
Problem description

tar won't work on emulated x86 based amazonlinux:2027 based containers: when extracting contents from any tar.gz archive, it will failed with messages like

/usr/sbin/tar: container-1.7.1/signing/container-network-vmnet.entitlements: Cannot open: Function not implemented
Environment
- OS: macOS 27.2.1 (26B131)
- Xcode: Version 27.2 (27B52)
- Container: container CLI version 1.7.1 (build: release, commit: unspeci)

Detailed info on container binary

$ bin/container system status
FIELD               VALUE
status              running
client.version      1.7.1-4-gd6f107c7
client.build        release
client.commit       d6f107c72643fb8f32a6bdc4ead78ee5b6b7c3b5
host.os             Version 27.2.1 (Build 26B131)
host.architecture   arm64
host.cpus           16
server.version      1.7.1-4-gd6f107c7
server.build        release
server.commit       d6f107c72643fb8f32a6bdc4ead78ee5b6b7c3b5
server.appName      container-apiserver
paths.appRoot       /Users/xliang/Library/Application Support/com.apple.container/
paths.installRoot   /Users/xliang/XL/container/
paths.logRoot
containers.total    1
containers.running  0
images.total        11
Code of Conduct
  • I agree to follow this project's Code of Conduct
Lingua principale
Swift
Stelle
51.9k
Fork
1.8k
Merge medio
2g 3h
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apple/container

Tutte le issue di apple/container

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.