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
docker_notes:docker-compose [2024-05-05 Sun wk18 12:35] – [Installation / Update] baumkpdocker_notes:docker-compose [2024-11-10 Sun wk45 12:24] (current) baumkp
Line 1: Line 1:
-{{tag>linux docker compose docker-compose "docker compose" container network nftables iptables nft}}+{{tag>linux docker compose docker-compose "docker compose" container network}}
 ======Docker-Compose====== ======Docker-Compose======
     *Docker Docs [[https://docs.docker.com/compose/compose-file/|Compose specification]], [[https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-and-name-top-level-elements|The Compose Specification]]     *Docker Docs [[https://docs.docker.com/compose/compose-file/|Compose specification]], [[https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-and-name-top-level-elements|The Compose Specification]]
Line 12: Line 12:
   *''docker-compose stop|start|restart'' it is better to use down and up commands has they force the recreation of the container (no image). This is as the scripts on start-up usually assume a new container.   *''docker-compose stop|start|restart'' it is better to use down and up commands has they force the recreation of the container (no image). This is as the scripts on start-up usually assume a new container.
   *''%%docker-compose build --pull%%'', will pull the latest images and rebuild a Docker file.   *''%%docker-compose build --pull%%'', will pull the latest images and rebuild a Docker file.
 +
 +====Docker Compose Versions/Types====
 +Docker compose can be installed as a specific program and run as ''docker-compose'' to it can be run as an add-in to docker and run as ''docker compose'' Not sure of the advantages of one over the other, however the latest version of the separate program ''docker-compose'' can be directly downloaded as described below, whereas the ''docker compose'' add-in is via distribution package manager.  Ultimately both methods seem to be functional.
 =====Installation / Update===== =====Installation / Update=====
 To check current version: ''%%docker-compose --version%%'' To check current version: ''%%docker-compose --version%%''
Line 17: Line 20:
 The latest version of docker-compose can be check here: [[https://github.com/docker/compose/releases | git hub docker compose releases]] change the version sub-directory as required. The latest version of docker-compose can be check here: [[https://github.com/docker/compose/releases | git hub docker compose releases]] change the version sub-directory as required.
 <code bash> <code bash>
-sudo curl -L "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose+sudo curl -L "https://github.com/docker/compose/releases/download/v2.30.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 sudo chmod +x /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
 </code> </code>
Line 168: Line 171:
 ''systemctl show docker.service'' shows the service definition, it looks like it shows all dependencies, not just main service file ones. ''systemctl show docker.service'' shows the service definition, it looks like it shows all dependencies, not just main service file ones.
  
-References:+====References==== 
 +  * Docker 
 +    * [[https://docs.docker.com/compose/compose-file/|Compose Specification Overview]] 
 +    * [[https://docs.docker.com/reference/dockerfile/|Dockerfile reference]] 
 +    * [[https://github.com/compose-spec/compose-spec/tree/main|compose specification]]
   * [[https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount|Set systemd service to execute after fstab mount]]   * [[https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount|Set systemd service to execute after fstab mount]]
   * [[https://unix.stackexchange.com/questions/398540/how-to-override-systemd-unit-file-settings|How to override systemd unit file settings?]]   * [[https://unix.stackexchange.com/questions/398540/how-to-override-systemd-unit-file-settings|How to override systemd unit file settings?]]
Line 178: Line 185:
   * [[https://www.freedesktop.org/software/systemd/man/systemd.unit.html#RequiresMountsFor=|systemd.unit — Unit configuration #RequiresMountsFor]]   * [[https://www.freedesktop.org/software/systemd/man/systemd.unit.html#RequiresMountsFor=|systemd.unit — Unit configuration #RequiresMountsFor]]
   * [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/assembly_working-with-systemd-unit-files_configuring-basic-system-settings|RedHat Docs Chapter 17. Working with systemd unit files]]   * [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/assembly_working-with-systemd-unit-files_configuring-basic-system-settings|RedHat Docs Chapter 17. Working with systemd unit files]]
 +  * [[https://gabrieltanner.org/blog/docker-compose/|The definitive Guide to Docker compose]]
  
  
 <- docker_notes:docker|Back ^ docker_notes:index|Start page ^ docker_notes:init|Next -> <- docker_notes:docker|Back ^ docker_notes:index|Start page ^ docker_notes:init|Next ->