With Ubuntu as a base Docker image, there is some license conflict where it is not possible to redistribute the image.
One way is to push it to hub.docker.com where the layers of base images are available so only the layers of the new image will be pushed.
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y gcc make
In the above Dockerfile, the first layer created by "FROM ubuntu:18.04" is already available in the docker hub so it will not be pushed and another layer from "RUN apt-get update && apt-get install -y gcc make" will only be pushed to the new repo. And during the docker pull command, the first layer is directly called from the Ubuntu distribution on docker hub so it will not create any license conflict for redistribution.
Now we are planning to move from the docker hub to private registry where we need to push the application. With the private registry, it will push both the layers(as the ubuntu base image is not available in the private registry). And while pulling the docker image from the private registry it will pull both the layers which conflict with the redistribution license from ubuntu.
So is there any way to push only a few layers to the private docker registry without pushing the layer of the base image?
And while pulling layers from different registries will be pulled and docker image can be loaded. Rather than using the docker pull command, there are chances where we can use curl or any other command to load the image.
There is a concept called foreign layer in Docker but unable to find any resource explaining how to create a foreign layer in the Manifest file. Microsoft used the concept of a foreign layer while distributing Windows-based Docker images.