DETAILS :
Docker Containers have a layered file system.
The Container root /
file system is not the Same as the Host root /
file system.
The Container /etc/
is not the Same as the Host /etc/
!
In that Scenario , Container /etc/os-release
may or may not be Host /etc/os-release
!
[[ Depends on what is mounted where ]]
With the layering , if the Container is still using the Host /etc/os-release
file [[ because of the Mount Points & Mappings ]] , then we will see the Host OS Details , whereas if the Container is using own or modified /etc/os-release
file , then we will see the Contents of that file which may be Same or Different.
Debian Docker Host running Ubuntu Docker Container , without own /etc/os-release
: /etc/os-release
will contain Debian.
Debian Docker Host running Debian Docker Container , with own /etc/os-release
: /etc/os-release
will contain Debian.
Debian Docker Host running Ubuntu Docker Container , with own /etc/os-release
: /etc/os-release
will contain Ubuntu.
SUMMARY :
When /etc/os-release
is updated in Container [[ It has own /etc
]] , then it will give Details of Container.
When /etc/os-release
is not updated in Container [[ Original /etc/
is made available via Mounting to Same Mount Point /etc/
]] , then it will give Details of Host.