Makefile template for docker-compose
Template and lib for docker-compose
To install mk-lib run command
curl -sL https://git.io/vh4Gn | sh
To upgrade existing mk-lib run command
make mk-upgrade
Common (see samples)
make console
- open container's consoleFrom Makefile.minimal.mk (see samples)
make start
- start all containersmake start
c=hello - start container hellomake stop
- stop all containersmake status
- show list of containers with statusesmake logs
- show logsmake clean
- clean all dataFrom this library
make help
- show help (see above)make mk-upgrade
- check for updates of mk-libmake mk-version
- show current version of mk-libBasic commands (you can copy and paste it into your Makefile)
up: ## Start all or c=<name> containers in foreground
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c)
start: ## Start all or c=<name> containers in background
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up -d $(c)
stop: ## Stop all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)
status: ## Show status of containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) ps
restart: ## Restart all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c) -d
logs: ## Show logs for all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) logs --tail=100 -f $(c)
clean: confirm ## Clean all data
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) down
You may see samples here
You can create .make.env file in directory with Makefile or current directory
Available variables
See CHANGELOG
MIT (see LICENSE)