When I run the following docker image in my mac(intel)
jenkins/jenkins
I get the following file structure:
drwxr-xr-x 1 root root 4096 Jun 23 11:13 .
drwxr-xr-x 1 root root 4096 Jun 23 11:13 ..
-rwxr-xr-x 1 root root 0 Jun 23 11:13 .dockerenv
drwxr-xr-x 1 root root 4096 Jun 20 14:11 bin
drwxr-xr-x 2 root root 4096 Apr 2 11:55 boot
drwxr-xr-x 5 root root 340 Jun 23 11:13 dev
drwxr-xr-x 1 root root 4096 Jun 23 11:13 etc
drwxr-xr-x 2 root root 4096 Apr 2 11:55 home
drwxr-xr-x 1 root root 4096 Jun 12 00:00 lib
drwxr-xr-x 2 root root 4096 Jun 12 00:00 lib64
drwxr-xr-x 2 root root 4096 Jun 12 00:00 media
drwxr-xr-x 2 root root 4096 Jun 12 00:00 mnt
drwxr-xr-x 1 root root 4096 Jun 20 14:11 opt
dr-xr-xr-x 224 root root 0 Jun 23 11:13 proc
drwx------ 1 root root 4096 Jun 23 05:50 root
drwxr-xr-x 1 root root 4096 Jun 23 11:13 run
drwxr-xr-x 1 root root 4096 Jun 20 14:10 sbin
drwxr-xr-x 2 root root 4096 Jun 12 00:00 srv
dr-xr-xr-x 13 root root 0 Jun 23 11:13 sys
drwxrwxrwt 1 root root 4096 Jun 23 11:13 tmp
drwxr-xr-x 1 root root 4096 Jun 12 00:00 usr
drwxr-xr-x 1 root root 4096 Jun 20 14:11 var
When i run the same image in mac(M1), I get some changes in file structure.
The noticeable one that cause me an error is that i dont find lib64 directory here in this container.
The following the directory structure:
drwxr-xr-x 1 root root 4096 Jun 23 11:21 .
drwxr-xr-x 1 root root 4096 Jun 23 11:21 ..
-rwxr-xr-x 1 root root 0 Jun 23 11:21 .dockerenv
drwxr-xr-x 1 root root 4096 Jun 20 14:15 bin
drwxr-xr-x 2 root root 4096 Apr 2 11:55 boot
drwxr-xr-x 5 root root 340 Jun 23 11:21 dev
drwxr-xr-x 1 root root 4096 Jun 23 11:21 etc
drwxr-xr-x 2 root root 4096 Apr 2 11:55 home
drwxr-xr-x 1 root root 4096 Jun 12 00:00 lib
drwxr-xr-x 2 root root 4096 Jun 12 00:00 media
drwxr-xr-x 2 root root 4096 Jun 12 00:00 mnt
drwxr-xr-x 1 root root 4096 Jun 20 14:15 opt
dr-xr-xr-x 208 root root 0 Jun 23 11:21 proc
drwx------ 1 root root 4096 Jun 20 14:15 root
drwxr-xr-x 3 root root 4096 Jun 12 00:00 run
drwxr-xr-x 1 root root 4096 Jun 20 14:12 sbin
drwxr-xr-x 2 root root 4096 Jun 12 00:00 srv
dr-xr-xr-x 13 root root 0 Jun 23 11:21 sys
drwxrwxrwt 1 root root 4096 Jun 23 11:21 tmp
drwxr-xr-x 1 root root 4096 Jun 12 00:00 usr
drwxr-xr-x 1 root root 4096 Jun 20 14:15 var
I dont see lib64 dir here. Just the lib directory.
Any idea about this difference? Docker containers should be same, be it hosted in any architecture?, if they are the same images? Correct me!
Thanks!
2
Answers
Docker images are indeed built for different architectures. See, for example, for the image you provided under the column "OS/ARCH": https://hub.docker.com/r/jenkins/jenkins/tags
See also the docker documentation for multi-platform images:
No, Container image for different architectures will be different. in your case both Mac machines have different architecture intel x86 M1 Arm
if you want to pull specific architecture image you can provide
--platform
flag