Added example of docker invocation to the Makefile
As suggested by @leoheck in 2233c0e08a
This commit is contained in:
parent
a746c48c99
commit
3028e67989
19
Makefile
19
Makefile
|
|
@ -3,6 +3,10 @@ tagname = 10.4-5.1.6
|
|||
docker_user = setsoft
|
||||
docker_img = setsoft/kicad_auto
|
||||
|
||||
CWD := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
|
||||
USER_ID=$(shell id -u)
|
||||
GROUP_ID=$(shell id -g)
|
||||
|
||||
download_packages:
|
||||
./download.sh
|
||||
|
||||
|
|
@ -17,7 +21,7 @@ upload_image:
|
|||
|
||||
release: build upload_image
|
||||
|
||||
# If docker is not installer int the host system
|
||||
# If docker is not installed in the host system
|
||||
install_docker:
|
||||
sudo apt install docker.io
|
||||
sudo systemctl enable --now docker
|
||||
|
|
@ -26,5 +30,18 @@ install_docker:
|
|||
clean:
|
||||
@ rm -rf *.deb
|
||||
|
||||
# Docker shell for the current user.
|
||||
# You can access the desktop and your home.
|
||||
# Changes to the docker image are discarded, but changes to your home are real changes.
|
||||
docker_shell:
|
||||
docker run -it --rm -v $(CWD):$(CWD) --workdir="$(CWD)" \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$(DISPLAY) \
|
||||
--user $(USER_ID):$(GROUP_ID) \
|
||||
--volume="/etc/group:/etc/group:ro" \
|
||||
--volume="/etc/passwd:/etc/passwd:ro" \
|
||||
--volume="/etc/shadow:/etc/shadow:ro" \
|
||||
--volume="/home/$(USER):/home/$(USER):rw" \
|
||||
$(docker_img):$(tagname) /bin/bash
|
||||
|
||||
.PHONY: download_packages build_release upload_image install_docker clean
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue