I have created my Docker compose and Dockerfile but as you can see I am downloading PHP from Docker Hub and also downloading and installing PHP extensions. But what if after 20 years those images / packages will no longer be hosted on Docker hub? What if I want to still be able to run my container then?
Can I somehow freeze my containers in time? Can I bundle it all together so that if I come back to it 100 years from now and run my image it will still work? I don't want it to go out and download anything from the internet. I want to download everything now and just run it in the future.
Docker compose file:
version: '3'
services:
php:
build:
context: ./php
dockerfile: Dockerfile
image: digitalocean.com/php
container_name: php
And my PHP Dockerfile:
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd