aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <cody.hiar@investopedia.com>2016-11-04 11:35:43 -0600
committerCody Hiar <cody.hiar@investopedia.com>2016-11-04 11:35:43 -0600
commite07410c71b3bbb73a296ddf22c52657f74609515 (patch)
tree7e37be7b3da3855b55007c6f5cf60a98a222618f
parent403bd1b54ca7d6328e0beadb5a79149a89563730 (diff)
Updating to use my new 'make' workflow
-rw-r--r--Dockerfile5
-rw-r--r--Makefile29
2 files changed, 24 insertions, 10 deletions
diff --git a/Dockerfile b/Dockerfile
index 86c58f0..5b74dd4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,6 +4,9 @@ FROM alpine:3.3
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
+# Makes using the terminal in container usable
+ENV TERM xterm-256color
+
# Install all the needed packages
RUN apk add --no-cache \
# My Stuff
@@ -79,6 +82,6 @@ RUN nvim +UpdateRemotePlugins +qa
ADD zshrc /root/.zshrc
-WORKDIR /work
+WORKDIR /app
CMD ["/bin/zsh"]
diff --git a/Makefile b/Makefile
index 340cc0f..30ab1e0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,26 @@
+.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}'
-build: ## Build the image
- clear
- make build-shellcheck
- docker build -t thornycrackers/neovim .
-
-build-shellcheck: ## build the shellcheck binaries
- clear
+build: ## Build the base image
docker build -t thornycrackers/shellcheck shellcheck-builder
docker run --rm -it -v $(CURDIR):/mnt thornycrackers/shellcheck
+ docker build -t thornycrackers/neovim .
+
+up: build ## Bring the container up
+ docker run -dP -v $(CURDIR):/app --name $(CONTAINERNAME) $(IMAGENAME) /bin/zsh -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/zsh
+
+clean: ## Remove the image and any stopped containers
+ docker rm $(CONTAINERNAME) || echo 'No container to remove'
+ docker rmi $(IMAGENAME) || echo 'No image to remove'
-enter: ## Enter the image
- docker run -i -t thornycrackers/neovim /bin/zsh