There is no difference between image storage and the container’s underlying file system, the layered FS accesses the image layers directly as the RO level, and the container uses the RW layer above to catch any changes. Therefore, your goal is to have a container running in memory while the Docker installation remains on disk, has no easy implementation.
If you know where your RW activity is (it’s quite simple to check the docker diff working container), the best option for me would be tmpfs mounted in this place in your container, which is initially supported by docker (from the link for launching dockers ):
$ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image
source share