Skip to content

Commit

Permalink
added makefile to simply running containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr1215 committed Jan 28, 2020
1 parent f420433 commit a1c8d0c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ZSH = piotrzan/kubectl-comp:zsh
BASH = piotrzan/kubectl-comp

.PHONY: all run-detatch-zsh run-zsh run-detatch-bash run-bash copy attach zsh-run bash-run

all: zsh-run

run-detatch-zsh:
docker run -d --network=host --name=kubectl-host --rm -it $(ZSH)

run-zsh:
docker run --network=host --name=kubectl-host --rm -it $(ZSH)

run-detatch-bash:
docker run -d --network=host --name=kubectl-host --rm -it $(BASH)

run-bash:
docker run --network=host --name=kubectl-host --rm -it $(BASH)

copy:
kubectl config view --raw > config
docker cp config kubectl-host:./root/.kube

attach:
docker attach kubectl-host

zsh-run: run-detatch-zsh copy attach

bash-run: run-detatch-bash copy attach
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ docker build --rm -f "Dockerfile" -t piotrzan/kubectl-comp:zsh "."
Use `run.ps1` or `run.sh` for windows or linux respectivels.
Alternatively use docker-compose.yaml, this works by mounting a volume on the $HOME/.kube folder on the host.

Another option is running `make` (defaults to content of run script). Linux has make installed by default, for Windows please install first [Make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm).
Another option is running `make` (defaults to content of run script). `Make` can be run from root directory and will run images depending on the tasks. Linux has `make` installed by default, for Windows please install first [Make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm).

ZSH container will be ran by default.

### Linux Example

Expand Down
18 changes: 0 additions & 18 deletions zsh/Makefile

This file was deleted.

0 comments on commit a1c8d0c

Please sign in to comment.