khuedoan-homelab/tools/Makefile

25 lines
506 B
Makefile
Raw Normal View History

2021-04-20 09:41:06 +07:00
.POSIX:
TAG = homelab-tools
default: build run
2021-04-20 09:41:06 +07:00
build:
@docker build . --tag ${TAG}
2021-04-20 09:41:06 +07:00
run:
@docker run \
2021-04-20 09:41:06 +07:00
--rm \
--interactive \
--tty \
--network host \
2021-04-20 09:41:06 +07:00
--env "TERM=${TERM}" \
--env "HOME=${HOME}" \
--volume "${HOME}:${HOME}" \
2021-04-20 09:41:06 +07:00
--volume "/var/run/docker.sock:/var/run/docker.sock" \
--volume "/etc/passwd:/etc/passwd" \
--user "$(shell id -u ${USER}):$(shell id -g ${USER})" \
--group-add "$(shell getent group docker | cut -d ':' -f 3)" \
--workdir "$(shell pwd)/.." \
2021-04-20 09:41:06 +07:00
${TAG}