mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 15:32:56 +00:00
Cleanup some commands in Makefile
This commit is contained in:
22
Makefile
22
Makefile
@@ -2,13 +2,14 @@
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
.PHONY: docs help test
|
||||
|
||||
# Use bash for inline if-statements in arch_patch target
|
||||
SHELL:=bash
|
||||
REGISTRY?=quay.io
|
||||
OWNER?=jupyter
|
||||
|
||||
# Need to list the images in build dependency order
|
||||
# All of the images
|
||||
# Enable BuildKit for Docker build
|
||||
export DOCKER_BUILDKIT:=1
|
||||
|
||||
# All the images listed in the build dependency order
|
||||
ALL_IMAGES:= \
|
||||
docker-stacks-foundation \
|
||||
base-notebook \
|
||||
@@ -22,9 +23,6 @@ ALL_IMAGES:= \
|
||||
pyspark-notebook \
|
||||
all-spark-notebook
|
||||
|
||||
# Enable BuildKit for Docker build
|
||||
export DOCKER_BUILDKIT:=1
|
||||
|
||||
|
||||
|
||||
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
||||
@@ -52,13 +50,13 @@ check-outdated-all: $(foreach I, $(ALL_IMAGES), check-outdated/$(I)) ## check al
|
||||
|
||||
|
||||
|
||||
cont-clean-all: cont-stop-all cont-rm-all ## clean all containers (stop + rm)
|
||||
cont-stop-all: ## stop all containers
|
||||
@echo "Stopping all containers ..."
|
||||
-docker stop --time 0 $(shell docker ps --all --quiet) 2> /dev/null
|
||||
cont-rm-all: ## remove all containers
|
||||
@echo "Removing all containers ..."
|
||||
-docker rm --force $(shell docker ps --all --quiet) 2> /dev/null
|
||||
cont-clean-all: cont-stop-all cont-rm-all ## clean all containers (stop + rm)
|
||||
|
||||
|
||||
|
||||
@@ -77,18 +75,18 @@ hook-all: $(foreach I, $(ALL_IMAGES), hook/$(I)) ## run post-build hooks for all
|
||||
|
||||
|
||||
|
||||
img-clean: img-rm-dang img-rm ## clean dangling and jupyter images
|
||||
img-list: ## list jupyter images
|
||||
@echo "Listing $(OWNER) images ..."
|
||||
docker images "$(OWNER)/*"
|
||||
docker images "*/$(OWNER)/*"
|
||||
img-rm: ## remove jupyter images
|
||||
@echo "Removing $(OWNER) images ..."
|
||||
-docker rmi --force $(shell docker images --quiet "$(OWNER)/*") 2> /dev/null
|
||||
-docker rmi --force $(shell docker images --quiet "*/$(OWNER)/*") 2> /dev/null
|
||||
img-rm-dang: ## remove dangling images (tagged None)
|
||||
@echo "Removing dangling images ..."
|
||||
-docker rmi --force $(shell docker images -f "dangling=true" --quiet) 2> /dev/null
|
||||
img-rm-jupyter: ## remove jupyter images
|
||||
@echo "Removing $(OWNER) images ..."
|
||||
-docker rmi --force $(shell docker images --quiet "$(OWNER)/*") 2> /dev/null
|
||||
-docker rmi --force $(shell docker images --quiet "*/$(OWNER)/*") 2> /dev/null
|
||||
img-rm: img-rm-dang img-rm-jupyter ## remove dangling and jupyter images
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user