tech_notes:docker-compose

Back  
 

Docker-Compose

...

One click installation script:

sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Install Docker Engine : Docker Engine

By default Docker-Compose will create a new network for the given compose file. You can change the behavior by defining custom networks in your compose file.

... Example:

networks:
  custom-network:

services:
  app:
    networks:
      - custom-network

If you want to use an existing Docker network for your compose files, you can add the external: true parameter in your compose file Example:

networks:
  existing-network:
    external: true

Volumes allow Docker containers to use persistent storage. In a compose file, you can create and map volumes like this:

volumes:
  my-volume:

services:
  app:
    volumes:
      - my-volume:/path-in-container

These volumes are stored in /var/lib/docker/volumes.

  • /mnt/shared/www/dokuwiki/data/pages/tech_notes/docker-compose.txt
  • Last modified: 2022-10-21 Fri wk42 07:15
  • by baumkp