1
0
mirror of https://github.com/pgrondek/config.git synced 2024-11-25 13:16:01 +00:00

[docker] Create makefile for installing docker

This commit is contained in:
Przemysław Grondek 2019-11-05 10:43:08 +01:00
parent fcbb957adc
commit 18354079ee
2 changed files with 40 additions and 1 deletions

View File

@ -1,4 +1,4 @@
SUB_DIRS=bash i3 packages ssh vim
SUB_DIRS=bash i3 packages ssh vim docker
.PHONY: clean_install

39
docker/Makefile Normal file
View File

@ -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