mirror of
https://github.com/pgrondek/config.git
synced 2024-11-22 12:03:43 +00:00
[docker] Add installation of docker-compose
This commit is contained in:
parent
18354079ee
commit
27f2fcf5b0
@ -17,23 +17,44 @@ DOCKER_PACKAGES=\
|
|||||||
docker-ce-cli \
|
docker-ce-cli \
|
||||||
containerd.io
|
containerd.io
|
||||||
|
|
||||||
|
HOME_BIN_DIR=$(HOME)/bin
|
||||||
|
|
||||||
|
DOCKER_BIN=/usr/bin/docker
|
||||||
|
DOCKER_COMPOSE_BIN=$(HOME_BIN_DIR)/docker-compose
|
||||||
|
DOCKER_REPO_FILE=/etc/apt/sources.list.d/docker.list
|
||||||
|
|
||||||
|
ROOT_TEE=sudo tee
|
||||||
ROOT_APT=sudo aptitude
|
ROOT_APT=sudo aptitude
|
||||||
ROOT_ADD_KEY=sudo apt-key
|
ROOT_ADD_KEY=sudo apt-key
|
||||||
ROOT_ADD_APT=sudo add-apt-repository
|
ROOT_ADD_USER_TO_GROUP=sudo adduser
|
||||||
ROOT_ADD_USER_TO_GROUP=adduser
|
|
||||||
RELEASE:=$(shell lsb_release -cs)
|
RELEASE:=$(shell lsb_release -cs)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(ROOT_APT) remove $(CLEAN_PACKAGES)
|
-docker system prune
|
||||||
|
-$(ROOT_APT) remove $(DOCKER_PACKAGES)
|
||||||
|
sudo rm -f $(DOCKER_COMPOSE_BIN)
|
||||||
|
sudo rm -f $(DOCKER_REPO_FILE)
|
||||||
|
-$(ROOT_ADD_KEY) del Docker
|
||||||
|
|
||||||
install:
|
install: install_docker install_compose
|
||||||
|
install_docker: $(DOCKER_BIN)
|
||||||
|
install_compose: $(DOCKER_COMPOSE_BIN)
|
||||||
|
|
||||||
|
$(DOCKER_BIN):
|
||||||
|
-$(ROOT_APT) remove $(CLEAN_PACKAGES)
|
||||||
$(ROOT_APT) update
|
$(ROOT_APT) update
|
||||||
$(ROOT_APT) install -y $(REQUIRED_PACKAGES)
|
$(ROOT_APT) install -y $(REQUIRED_PACKAGES)
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | $(ROOT_ADD_KEY) add -
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | $(ROOT_ADD_KEY) add -
|
||||||
$(ROOT_ADD_APT) \
|
echo "deb https://download.docker.com/linux/ubuntu $(RELEASE) stable" \
|
||||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
| $(ROOT_TEE) $(DOCKER_REPO_FILE)
|
||||||
$(RELEASE) \
|
|
||||||
stable"
|
|
||||||
$(ROOT_APT) update
|
$(ROOT_APT) update
|
||||||
$(ROOT_APT) install -y $(DOCKER_PACKAGES)
|
$(ROOT_APT) install -y $(DOCKER_PACKAGES)
|
||||||
$(ROOT_ADD_USER_TO_GROUP) $(shell id -nu) docker
|
$(ROOT_ADD_USER_TO_GROUP) $(shell id -nu) docker
|
||||||
|
|
||||||
|
|
||||||
|
$(DOCKER_COMPOSE_BIN): $(HOME_BIN_DIR)
|
||||||
|
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(shell uname -s)-$(shell uname -m)" -o $(DOCKER_COMPOSE_BIN)
|
||||||
|
chmod +x $(DOCKER_COMPOSE_BIN)
|
||||||
|
|
||||||
|
$(HOME_BIN_DIR):
|
||||||
|
mkdir -p $(HOME_BIN_DIR)
|
||||||
|
Loading…
Reference in New Issue
Block a user