From 18354079eee9dd4ed4abb23256823b1621fb2b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Grondek?= Date: Tue, 5 Nov 2019 10:43:08 +0100 Subject: [PATCH] [docker] Create makefile for installing docker --- Makefile | 2 +- docker/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 docker/Makefile 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