cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

middleware:container:docker:docker-compose



docker-compose

Reference

Command

docker-compose up -d start docker-compose Execute in the directory where docker-compose.yml is located
docker-compose down stop docker-compose
docker-compose ps Container list
docker-compose exec CONTAINER /bin/bash Enter a running container
docker-compose kill Forcibly stop all containers
docker-compose rm Delete all containers


Install

# pip install docker-compose

or

# curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
# docker-compose --version


Uninstall

pip uninstall docker-compose

or

rm /usr/local/bin/docker-compose


Example1

Docker Registry


MyApp

./app
./app/counter.php
./mysql
./mysql/init
./mysql/init/init.sql
./mysql/data
./htdocs
./docker-compose.yml
./build
./build/phpapp
./build/phpapp/Dockerfile



docker-compose.yml

version: "2"
services:
  mysql:
    image: mysql:5.7
    ports:
      - "3306:3306"
    volumes:
      - "./mysql/init:/docker-entrypoint-initdb.d"
      - "./mysql/data:/var/lib/mysql"
    environment:
      - MYSQL_ROOT_PASSWORD=secret
  phpapp:
    image: phpapp
    build: ./build/phpapp
    volumes:
      - "./app:/var/www/html"
    ports:
      - "8080:80"

https://qiita.com/hiyuzawa/items/81490020568417d85e86




middleware/container/docker/docker-compose.txt ยท Last modified: 2020/05/15 by admin

Page Tools