2021-04-20 09:41:06 +07:00
|
|
|
.POSIX:
|
|
|
|
|
|
|
|
TAG = homelab-tools
|
|
|
|
|
2021-06-08 18:41:46 +07:00
|
|
|
default: build run
|
2021-04-20 09:41:06 +07:00
|
|
|
|
|
|
|
build:
|
2021-11-27 20:52:38 +07:00
|
|
|
@docker build . --tag ${TAG}
|
2021-04-20 09:41:06 +07:00
|
|
|
|
|
|
|
run:
|
2021-11-27 20:52:38 +07:00
|
|
|
@docker run \
|
2021-04-20 09:41:06 +07:00
|
|
|
--rm \
|
|
|
|
--interactive \
|
|
|
|
--tty \
|
2021-05-16 14:32:01 +07:00
|
|
|
--network host \
|
2021-04-20 09:41:06 +07:00
|
|
|
--env "TERM=${TERM}" \
|
2021-06-20 03:42:00 +07:00
|
|
|
--env "HOME=${HOME}" \
|
|
|
|
--volume "${HOME}:${HOME}" \
|
2021-04-20 09:41:06 +07:00
|
|
|
--volume "/var/run/docker.sock:/var/run/docker.sock" \
|
2022-01-16 14:28:45 +07:00
|
|
|
--volume "/etc/passwd:/etc/passwd" \
|
|
|
|
--user "$(shell id -u ${USER}):$(shell id -g ${USER})" \
|
|
|
|
--group-add "$(shell getent group docker | cut -d ':' -f 3)" \
|
2021-06-20 03:42:00 +07:00
|
|
|
--workdir "$(shell pwd)/.." \
|
2021-04-20 09:41:06 +07:00
|
|
|
${TAG}
|