Docker Compose
install
- curl -L https://github.com/docker/compose/releases/download/1.13.0-rc1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
Vorbereitung
example
version: "3.7" services: apache: image: httpd:2.4 container_name: my-apache restart: always ports: - 9080:80 volumes: - /srv/apache2/htdocs:/usr/local/apache2/htdocs/
start
foreground
- docker-compose up
background
- docker-compose up -d
stop
- docker-compose stop