DEV Community

Discussion on: Go — build a minimal docker image in just three steps

Collapse
 
ivan profile image
Ivan Dlugos • Edited

Thanks for the update. I am aware of issues with mismatching glibc versions but was under an impression that an application wouldn't even start with a library missing from the image. That's why the Dockerfile contains library collection script. Here's a dive printout of a sample image contents for a dynamically linked application.

[Aggregated Layer Contents]────────────────────────────────
Permission     UID:GID       Size  Filetree
drwxr-xr-x     65534:0        0 B  ├── data 
drwxr-xr-x         0:0     4.8 MB  ├── lib64                   
-rwxr-xr-x         0:0     163 kB  │   ├── ld-linux-x86-64.so.2
-rwxr-xr-x         0:0     2.2 MB  │   ├── libc.so.6 
-rwxr-xr-x         0:0      19 kB  │   ├── libdl.so.2   
-rwxr-xr-x         0:0      89 kB  │   ├── libgcc_s.so.1
-rwxr-xr-x         0:0     1.1 MB  │   ├── libm.so.6      
-rwxr-xr-x         0:0     142 kB  │   ├── libpthread.so.0
-rwxr-xr-x         0:0     992 kB  │   ├── libstdc++.so.6
-rwxr-xr-x         0:0      90 kB  │   └── libz.so.1
-rwxr-xr-x         0:0     7.7 MB  └── service

However, I'll certainly have a look at how this behaves on an ancient system. Your mention of CentOS 6 is a good example of one still fairly used (unfortunately).