Allow choice of container engine in Makefile
This commit is contained in:
parent
7dc1dd792f
commit
5259e5a3ec
53
Makefile
53
Makefile
@ -12,11 +12,18 @@ uninstall:
|
||||
rm /lib/systemd/system/loki-server.service
|
||||
systemctl daemon-reload
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# The container engine to use. Default to docker, but on Fedora must now use
|
||||
# podman.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
ENGINE = docker
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# The container registry to use.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
DOCKER_REGISTRY = registry.wojciechkozlowski.eu/wojtek/loki
|
||||
REGISTRY = registry.wojciechkozlowski.eu/wojtek/loki
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Default target.
|
||||
@ -28,19 +35,19 @@ default: all
|
||||
# html
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
HTML = $(DOCKER_REGISTRY)/html
|
||||
HTML = $(REGISTRY)/html
|
||||
|
||||
html-clean:
|
||||
docker rmi $(HTML) || /bin/true
|
||||
$(ENGINE) rmi $(HTML) || /bin/true
|
||||
|
||||
html-build:
|
||||
docker build -f html/Dockerfile -t $(HTML) ./html
|
||||
$(ENGINE) build -f html/Dockerfile -t $(HTML) ./html
|
||||
|
||||
html-push:
|
||||
docker push $(HTML)
|
||||
$(ENGINE) push $(HTML)
|
||||
|
||||
html-pull:
|
||||
docker pull $(HTML)
|
||||
$(ENGINE) pull $(HTML)
|
||||
|
||||
html: html-clean html-build html-push
|
||||
|
||||
@ -48,19 +55,19 @@ html: html-clean html-build html-push
|
||||
# proxy
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
PROXY = $(DOCKER_REGISTRY)/proxy
|
||||
PROXY = $(REGISTRY)/proxy
|
||||
|
||||
proxy-clean:
|
||||
docker rmi $(PROXY) || /bin/true
|
||||
$(ENGINE) rmi $(PROXY) || /bin/true
|
||||
|
||||
proxy-build:
|
||||
docker build -f proxy/Dockerfile -t $(PROXY) ./proxy
|
||||
$(ENGINE) build -f proxy/Dockerfile -t $(PROXY) ./proxy
|
||||
|
||||
proxy-push:
|
||||
docker push $(PROXY)
|
||||
$(ENGINE) push $(PROXY)
|
||||
|
||||
proxy-pull:
|
||||
docker pull $(PROXY)
|
||||
$(ENGINE) pull $(PROXY)
|
||||
|
||||
proxy: proxy-clean proxy-build proxy-push
|
||||
|
||||
@ -68,19 +75,19 @@ proxy: proxy-clean proxy-build proxy-push
|
||||
# wiki
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
WIKI = $(DOCKER_REGISTRY)/wiki
|
||||
WIKI = $(REGISTRY)/wiki
|
||||
|
||||
wiki-clean:
|
||||
docker rmi $(WIKI) || /bin/true
|
||||
$(ENGINE) rmi $(WIKI) || /bin/true
|
||||
|
||||
wiki-build:
|
||||
docker build -f dokuwiki/Dockerfile -t $(WIKI) ./dokuwiki
|
||||
$(ENGINE) build -f dokuwiki/Dockerfile -t $(WIKI) ./dokuwiki
|
||||
|
||||
wiki-push:
|
||||
docker push $(WIKI)
|
||||
$(ENGINE) push $(WIKI)
|
||||
|
||||
wiki-pull:
|
||||
docker pull $(WIKI)
|
||||
$(ENGINE) pull $(WIKI)
|
||||
|
||||
wiki: wiki-clean wiki-build wiki-push
|
||||
|
||||
@ -88,19 +95,19 @@ wiki: wiki-clean wiki-build wiki-push
|
||||
# nextcloud
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
NEXTCLOUD = $(DOCKER_REGISTRY)/nextcloud
|
||||
NEXTCLOUD = $(REGISTRY)/nextcloud
|
||||
|
||||
nextcloud-clean:
|
||||
docker rmi $(NEXTCLOUD) || /bin/true
|
||||
$(ENGINE) rmi $(NEXTCLOUD) || /bin/true
|
||||
|
||||
nextcloud-build:
|
||||
docker build -f nextcloud/Dockerfile -t $(NEXTCLOUD) ./nextcloud
|
||||
$(ENGINE) build -f nextcloud/Dockerfile -t $(NEXTCLOUD) ./nextcloud
|
||||
|
||||
nextcloud-push:
|
||||
docker push $(NEXTCLOUD)
|
||||
$(ENGINE) push $(NEXTCLOUD)
|
||||
|
||||
nextcloud-pull:
|
||||
docker pull $(NEXTCLOUD)
|
||||
$(ENGINE) pull $(NEXTCLOUD)
|
||||
|
||||
nextcloud: nextcloud-clean nextcloud-build nextcloud-push
|
||||
|
||||
@ -109,8 +116,8 @@ nextcloud: nextcloud-clean nextcloud-build nextcloud-push
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
clean-all:
|
||||
docker container prune -f
|
||||
docker image prune -a -f
|
||||
$(ENGINE) container prune -f
|
||||
$(ENGINE) image prune -a -f
|
||||
|
||||
clean-builds: \
|
||||
html-clean \
|
||||
|
Reference in New Issue
Block a user