Both sides previous revision Previous revision Next revision | Previous revision |
docker_notes:docker-compose [2023-08-31 Thu wk35 19:02] – [Installation / Update] baumkp | docker_notes:docker-compose [2024-05-05 Sun wk18 12:35] (current) – [Installation / Update] baumkp |
---|
{{tag>linux docker compose docker-compose "docker compose" container}} | {{tag>linux docker compose docker-compose "docker compose" container network nftables iptables nft}} |
======Docker-Compose====== | ======Docker-Compose====== |
*Docker Docs [[https://docs.docker.com/compose/compose-file/|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]] |
| |
Some commands: | Some commands: |
*''docker-compose down'' | *''docker-compose down'' |
*''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. |
=====Installation / Update===== | =====Installation / Update===== |
To check current version: ''%%docker-compose --version%%'' | To check current version: ''%%docker-compose --version%%'' |
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.21.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | 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 chmod +x /usr/local/bin/docker-compose | sudo chmod +x /usr/local/bin/docker-compose |
</code> | </code> |
external: true | external: true |
</code> | </code> |
| |
| |
=====Volumes===== | =====Volumes===== |
Volumes allow Docker containers to use persistent storage. In a compose file, you can create and map volumes like this: | Volumes allow Docker containers to use persistent storage. In a compose file, you can create and map volumes like this: |
| |
| |
<- docker_notes:docker|Back ^ docker_notes:index|Start page ^ docker_notes:docker-reverse-proxy|Next -> | <- docker_notes:docker|Back ^ docker_notes:index|Start page ^ docker_notes:init|Next -> |
| |