Say I build a container where:
- the first layer is not using a base image, and contains only something like:
COPY /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
- the second layer is essentially an Alpine base image
Since the first layer does not have the /etc/os-release and related, it will not be detected as Alpine.
The same issue may exist with other distros.
The solution is to look at all the layers before deciding on what the primary OS is (and also nothing prohibits to have multiple OS personalities across layers or even in the same layer(
Say I build a container where:
COPY /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crtSince the first layer does not have the /etc/os-release and related, it will not be detected as Alpine.
The same issue may exist with other distros.
The solution is to look at all the layers before deciding on what the primary OS is (and also nothing prohibits to have multiple OS personalities across layers or even in the same layer(