User Tools

Site Tools


doc:appunti:linux:sa:docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:docker [2025/11/06 10:02] – [Esempio di esecuzione di un container] niccolodoc:appunti:linux:sa:docker [2025/11/06 10:56] (current) – [Esempio di esecuzione di un container] niccolo
Line 56: Line 56:
 docker.io/matrixdotorg/synapse:latest docker.io/matrixdotorg/synapse:latest
 </code> </code>
 +
 +FIXME Verificare se l'immagine viene da [[https://hub.docker.com]].
  
 ===== Gestione delle immagini e dei container ===== ===== Gestione delle immagini e dei container =====
Line 72: Line 74:
 ===== Esempio di esecuzione di un container ===== ===== Esempio di esecuzione di un container =====
  
-Proviamo ad eseguire un'istanza di [[https://hub.docker.com/r/matrixdotorg/synapse|Matrix Synapse]], si tratta di un servizio che richiede le seguenti risorse:+Proviamo ad eseguire un'istanza di [[https://hub.docker.com/r/matrixdotorg/synapse|Matrix Synapse]], si tratta di un servizio abbastanza complesso che richiede le seguenti risorse:
  
   * Un **file di configurazione**.   * Un **file di configurazione**.
Line 85: Line 87:
  
 <file> <file>
-Config file '/data/homeserver.yaml' does not exist. You should +Config file '/data/homeserver.yaml' does not exist. You should either create a new config 
-either create a new config file by running with the `generate` +file by running with the `generate` argument (and then edit the resulting file before 
-argument (and then edit the resulting file before restarting) +restarting) or specify the path to an existing config file with the SYNAPSE_CONFIG_PATH 
-or specify the path to an existing config file with the +variable.
-SYNAPSE_CONFIG_PATH variable.+
 </file> </file>
  
 +Leggendo la [[https://hub.docker.com/r/matrixdotorg/synapse|documentazione]] si scopre che il container va creato con il parametro **generate**. È necessario inoltre definire alcune variabili d'ambiente con l'opzione **%%-e%%**, collegare un mount del filesystem al container con l'opzione **%%--mount%%**. Le opzioni **%%-it%%** servono a tenere lo STDIN collegato allocando uno pseudo-TTY. L'opzione **%%--rm%%** rimuove automaticamente il container al momento dell'uscita.
  
 +<code>
 +docker run -it --rm \
 +    --mount type=volume,src=synapse-data,dst=/data \
 +    -e SYNAPSE_SERVER_NAME=my.matrix.host \
 +    -e SYNAPSE_REPORT_STATS=yes \
 +    matrixdotorg/synapse:latest generate
 +</code>
 ===== Risorse impegnate sull'host locale ===== ===== Risorse impegnate sull'host locale =====
  
doc/appunti/linux/sa/docker.1762419746.txt.gz · Last modified: by niccolo