Commit 3d41df5
committed
cmd/create: Integrate cross-architecture support into container creation
Add the --arch flag to the 'create' command, allowing users to create
Toolbx containers for architectures different from the host
(e.g., 'toolbox create --arch arm64').
Utilize the architecture resolution pipeline in create() by using
resolveArchitectureID() (added in [1]) to determine the target
architecture from the --arch flag and image tags.
Validate host support via IsArchSupportedOnCreation() (added in [2]),
which checks for the required QEMU emulator and binfmt_misc
registration.
Pass architecture ID to resolveContainerAndImageNames() (updated in [1])
so that non-native containers get architecture-suffixed names.
Update pullImage() to handle cross-architecture image pulling: when the
target architecture is non-native, use skopeo.CopyOverrideArch()
(added in [3]) instead of podman.Pull(), since Podman does not support
pulling foreign architecture images into locally addressable names.
The need for this is explained in a discussion in [4].
Add a 'toolbox-arch' label to created containers to record the target
architecture in OCI format.
Extract the image pull error formatting into createErrorImagePull() in
utils.go to avoid duplication between the native and cross-arch pull
paths.
Update the createContainer() call in run.go to pass the default
architecture config via GetArchConfigDefault(), maintaining the
existing native-architecture behavior.
[1] containers#1786
[2] containers#1783
[3] containers#1784
[4] podman-container-tools/podman#27780
containers#1787
Signed-off-by: Dalibor Kricka <dalidalk@seznam.cz>1 parent d7c6aef commit 3d41df5
3 files changed
Lines changed: 73 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| |||
171 | 178 | | |
172 | 179 | | |
173 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
174 | 199 | | |
175 | 200 | | |
176 | 201 | | |
177 | 202 | | |
178 | 203 | | |
179 | | - | |
| 204 | + | |
180 | 205 | | |
181 | 206 | | |
182 | 207 | | |
183 | 208 | | |
184 | 209 | | |
185 | | - | |
| 210 | + | |
186 | 211 | | |
187 | 212 | | |
188 | 213 | | |
189 | 214 | | |
190 | 215 | | |
191 | 216 | | |
192 | | - | |
| 217 | + | |
193 | 218 | | |
194 | 219 | | |
195 | 220 | | |
| |||
216 | 241 | | |
217 | 242 | | |
218 | 243 | | |
219 | | - | |
| 244 | + | |
220 | 245 | | |
221 | 246 | | |
222 | 247 | | |
| 248 | + | |
223 | 249 | | |
224 | 250 | | |
225 | 251 | | |
226 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
227 | 257 | | |
228 | 258 | | |
229 | 259 | | |
| |||
448 | 478 | | |
449 | 479 | | |
450 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
451 | 485 | | |
452 | 486 | | |
453 | 487 | | |
| |||
663 | 697 | | |
664 | 698 | | |
665 | 699 | | |
666 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
667 | 703 | | |
668 | 704 | | |
669 | 705 | | |
670 | | - | |
| 706 | + | |
671 | 707 | | |
672 | 708 | | |
673 | 709 | | |
| |||
678 | 714 | | |
679 | 715 | | |
680 | 716 | | |
681 | | - | |
| 717 | + | |
682 | 718 | | |
683 | 719 | | |
684 | 720 | | |
| |||
690 | 726 | | |
691 | 727 | | |
692 | 728 | | |
693 | | - | |
| 729 | + | |
694 | 730 | | |
695 | 731 | | |
696 | 732 | | |
697 | | - | |
698 | | - | |
699 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
700 | 738 | | |
701 | 739 | | |
702 | 740 | | |
| |||
721 | 759 | | |
722 | 760 | | |
723 | 761 | | |
724 | | - | |
| 762 | + | |
725 | 763 | | |
726 | 764 | | |
727 | 765 | | |
728 | 766 | | |
729 | 767 | | |
730 | 768 | | |
731 | | - | |
| 769 | + | |
732 | 770 | | |
733 | 771 | | |
734 | 772 | | |
735 | 773 | | |
736 | 774 | | |
737 | 775 | | |
738 | 776 | | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
| 777 | + | |
| 778 | + | |
744 | 779 | | |
745 | | - | |
746 | | - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
747 | 789 | | |
748 | 790 | | |
749 | | - | |
| 791 | + | |
750 | 792 | | |
751 | 793 | | |
752 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
297 | 306 | | |
298 | 307 | | |
299 | 308 | | |
| |||
0 commit comments