diff --git a/Makefile b/Makefile index ec5e7ab..a23a4cb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUB_DIRS=bash i3 packages ssh vim +SUB_DIRS=bash i3 packages ssh vim docker .PHONY: clean_install diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 0000000..b95fec3 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,39 @@ +CLEAN_PACKAGES=\ + docker \ + docker-engine \ + docker.io \ + containerd \ + runc + +REQUIRED_PACKAGES=\ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common + +DOCKER_PACKAGES=\ + docker-ce \ + docker-ce-cli \ + containerd.io + +ROOT_APT=sudo aptitude +ROOT_ADD_KEY=sudo apt-key +ROOT_ADD_APT=sudo add-apt-repository +ROOT_ADD_USER_TO_GROUP=adduser +RELEASE:=$(shell lsb_release -cs) + +clean: + $(ROOT_APT) remove $(CLEAN_PACKAGES) + +install: + $(ROOT_APT) update + $(ROOT_APT) install -y $(REQUIRED_PACKAGES) + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | $(ROOT_ADD_KEY) add - + $(ROOT_ADD_APT) \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(RELEASE) \ + stable" + $(ROOT_APT) update + $(ROOT_APT) install -y $(DOCKER_PACKAGES) + $(ROOT_ADD_USER_TO_GROUP) $(shell id -nu) docker