使用 makefile 管理 docker-compose

Makefile 文件可以这么写:

NAME = ponponon/ideaboom
VERSION = 1.0.1

.PHONY: build up stop logs

build:  docker-build
up: docker-compose-up
stop: docker-compose-stop
logs: docker-compose-logs

docker-build:
    docker build -t "${NAME}" .

docker-compose-up:
    docker-compose up -d

docker-compose-stop:
    docker-compose stop

docker-compose-logs:
    docker-compose logs --tail=100 -f

你可能感兴趣的:(makedocker)