aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 332c1a671241ef04cc917399fe998ed94d396893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.PHONY: build

CONTAINERNAME=nvim-env
IMAGENAME=thornycrackers/neovim

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

setup: ## Clone down additional repos that are needed for building
	rm -rf nvim vim-options
	git clone https://github.com/thornycrackers/.nvim.git nvim
	git clone https://github.com/thornycrackers/vim-options.git

build: ## Build the base image
	docker build -t thornycrackers/neovim .

build-nocache: ## Build the base image with no cache
	docker build --no-cache=true -t thornycrackers/neovim .

up: build ## Bring the container up
	docker run -dP -v $(CURDIR):/root/app --name $(CONTAINERNAME) $(IMAGENAME) /bin/bash -c 'while true; do echo hi; sleep 1; done;'

down: ## Stop the container
	docker stop $(CONTAINERNAME) || echo 'No container to stop'

enter: ## Enter the running container
	docker exec -it $(CONTAINERNAME) /bin/bash

clean: down ## Remove the image and any stopped containers
	docker rm $(CONTAINERNAME) || echo 'No container to remove'
	
push: ## Push the container to dockerhub
	docker push $(IMAGENAME)