Si desidera imparare a eseguire più servizi in un contenitore? In questo tutorial, ti mostreremo tutti i passaggi necessari per eseguire più servizi in un contenitore Docker su un computer che esegue Ubuntu Linux.

Ubuntu 18,04
Ubuntu 19.10
– Docker 19.03.6

In questo esempio, un contenitore Docker eseguirà il servizio MySQL e il servizio Apache.

Il servizio Apache sarà in ascolto sulla porta TCP 80.

Il servizio MySQL sarà in ascolto sulla porta TCP 3306.The MySQL service will listen on the TCP port 3306.

Docker – Esercitazione correlata:

In questa pagina, offriamo l’accesso a un elenco di tutorial relativi a Docker.

Tutorial Docker – Multiple services on a Container

Install the Docker package.

Download the Ubuntu docker image.

Start a new Ubuntu container.

In our example, a new Ubuntu container was created.

The container name is MYCONTAINER and its ID is 62f9adcafb62.

On the container command-line, install a list of required packages.

Install the Apache service with PHP support enabled.

Configure the desired timezone.

In our example, we configured the Brazilian Timezone from São Paulo.

Copy to Clipboard

Install the MySQL service.

Copy to Clipboard

Edit the MySQL configuration file named mysqld.cnf.

Copy to Clipboard

Locate the following line.

Copy to Clipboard

Change its value to 0.0.0.0.

Copy to Clipboard