util/docker: Minor Makefile updates
- Update url for docker install instructions. - Update docker-cleanall target to require verification. - Update docker-jenkins-attach target to check for docker and use docker variable. - Update spaces to tabs in the docs targets. Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: Ic1e1a545024fe1fdc37d7d8c7e6f54f124d1697b Reviewed-on: https://review.coreboot.org/c/coreboot/+/47342 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
82a30a134c
commit
44cfde02d5
|
@ -31,8 +31,8 @@ GID ?= $(shell id -g)
|
||||||
|
|
||||||
test-docker:
|
test-docker:
|
||||||
$(if $(DOCKER),,\
|
$(if $(DOCKER),,\
|
||||||
$(warning Docker command not found. Please install docker) \
|
$(warning Error: Docker command not found. Please install docker) \
|
||||||
$(warning https://docs.docker.com/engine/installation ) \
|
$(warning Instructions: https://docs.docker.com/engine/install/ ) \
|
||||||
$(error halting))
|
$(error halting))
|
||||||
|
|
||||||
test-docker-login: test-docker
|
test-docker-login: test-docker
|
||||||
|
@ -82,14 +82,19 @@ clean-coreboot-images: docker-killall
|
||||||
docker-clean: clean-coreboot-containers
|
docker-clean: clean-coreboot-containers
|
||||||
@$(MAKE) clean-coreboot-images
|
@$(MAKE) clean-coreboot-images
|
||||||
|
|
||||||
docker-cleanall:
|
docker-cleanall: test-docker
|
||||||
|
ifeq($(Y),1)
|
||||||
@if [ -n "$$($(DOCKER) ps -a | grep -v "CONTAINER")" ]; then \
|
@if [ -n "$$($(DOCKER) ps -a | grep -v "CONTAINER")" ]; then \
|
||||||
$(DOCKER) kill $$($(DOCKER) ps -a | grep -v "CONTAINER" | sed 's|\s.*$$||'); \
|
$(DOCKER) kill $$($(DOCKER) ps | grep -v "CONTAINER" | sed 's|\s.*$$||') ; \
|
||||||
$(DOCKER) rm $$($(DOCKER) ps -a | grep -v "CONTAINER" | sed 's|\s.*$$||'); \
|
$(DOCKER) rm $$($(DOCKER) ps -a | grep -v "CONTAINER" | sed 's|\s.*$$||'); \
|
||||||
fi
|
fi
|
||||||
@if [ -n "$$($(DOCKER) images | grep -v "REPOSITORY")" ]; then \
|
@if [ -n "$$($(DOCKER) images | grep -v "REPOSITORY")" ]; then \
|
||||||
$(DOCKER) rmi $$($(DOCKER) images | grep -v "REPOSITORY" | tr -s ' ' | cut -f3 -d ' '); \
|
$(DOCKER) rmi $$($(DOCKER) images | grep -v "REPOSITORY" | tr -s ' ' | cut -f3 -d ' '); \
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "This will remove *ALL* docker containers from your machine."
|
||||||
|
echo "If this is what you want, run 'make docker-cleanall Y=1'"
|
||||||
|
endif
|
||||||
|
|
||||||
$(DOCKER_CCACHE):
|
$(DOCKER_CCACHE):
|
||||||
@mkdir -p $@
|
@mkdir -p $@
|
||||||
|
@ -153,8 +158,8 @@ docker-shell: test-docker
|
||||||
/bin/bash -l
|
/bin/bash -l
|
||||||
|
|
||||||
docker-jenkins-attach: USER=root
|
docker-jenkins-attach: USER=root
|
||||||
docker-jenkins-attach:
|
docker-jenkins-attach: test-docker
|
||||||
docker exec --user $(USER) \
|
$(DOCKER) exec --user $(USER) \
|
||||||
-e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) -e TERM=$(TERM) \
|
-e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) -e TERM=$(TERM) \
|
||||||
-it "$$(docker ps | grep coreboot-jenkins-node | cut -f1 -d' ')" \
|
-it "$$(docker ps | grep coreboot-jenkins-node | cut -f1 -d' ')" \
|
||||||
/bin/bash -l
|
/bin/bash -l
|
||||||
|
@ -162,16 +167,16 @@ docker-jenkins-attach:
|
||||||
docker-build-docs: test-docker
|
docker-build-docs: test-docker
|
||||||
docker-build-docs:
|
docker-build-docs:
|
||||||
$(DOCKER) run -it --rm \
|
$(DOCKER) run -it --rm \
|
||||||
--user $(UID):$(GID) \
|
--user $(UID):$(GID) \
|
||||||
-v "$(top)/:/data-in/:ro" \
|
-v "$(top)/:/data-in/:ro" \
|
||||||
-v "$(top)/Documentation/_build/:/data-out/" \
|
-v "$(top)/Documentation/_build/:/data-out/" \
|
||||||
doc.coreboot.org
|
doc.coreboot.org
|
||||||
|
|
||||||
docker-livehtml-docs: test-docker
|
docker-livehtml-docs: test-docker
|
||||||
docker-livehtml-docs:
|
docker-livehtml-docs:
|
||||||
$(DOCKER) run -it --rm \
|
$(DOCKER) run -it --rm \
|
||||||
--net=host -v "$(top)/:/data-in/:ro" \
|
--net=host -v "$(top)/:/data-in/:ro" \
|
||||||
doc.coreboot.org livehtml
|
doc.coreboot.org livehtml
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Commands for working with docker images:"
|
@echo "Commands for working with docker images:"
|
||||||
|
|
Loading…
Reference in New Issue