Create 2 different containers starting from the same image and choice of the image

My project works, I have no support request this time, but I only have 2 small doubts. If you allow a simple chat. Forgive the double question in the same post but it’s a very simple thing.

Question 1

I have a Dockerfile describing an image. I want to use this image to create 2 different containers. Is it right to do it this way?

  service-a:
    build: ./apache-php
    image: image-apache-php-eb:v.1.0
    ...

  service-b:
    build: ./apache-php
    image: image-apache-php-eb:v.1.0
    ...

Question 2

When I search on Docker Hub I am always spoiled for choice. For example is it better ‘mysql:8.0.30’ or ‘mysql:8.0.30-debian’? What is the difference? Which criteria should I use to choose?
Among these images that I use, are there any that you would suggest me to change?

mysql:8.0.30
php:8.0.24RC1-apache
wordpress:6.0.2
phpmyadmin:5.2.0

The question is not about the version number but what comes next (alpine, cli, etc …). Most of the time I choose at random.

Hi

  1. Yes that should be okay.

  2. I think its up to you to decide which flavor of image you want, typically alpine is smaller in size, and debian have more posibilities if you want to add something to that image yourself. But in functionality of fx. mysql, there is no difference

PHP is a bit special, it really depends on what you want to do, PHP-CLI if you have a php console application, PHP-apache if you want to bundle PHP with apache webserver, but that is described better here Docker Hub

1 Like

With Traefik I have problems getting the certificate.

What does the traefik logs give you?

1 Like

The malfunctions of traefik were due to something else.