[CentOS8] docker-compose

$ sudo curl -L “https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose –version
docker-compose version 1.28.5, build c4eb3a1f

Dockerfile

FROM alpine
RUN apk add bash procps curl
CMD sh -c "(while :; do date; sleep 1; done) >&2"

docker-compose.yml

version: "3"

services:
  myalpine:
    build: "."
    tty: true

$ docker images
$ docker-compose up -d
$ docker ps
$ docker-compose stop

version: '3.7'

services:
  nginx:
    image: nginx
    ports:
      - 8080:80

$ docker-compose up -d

複数のコンテナ起動に威力を発揮する