build: set up Makefile
This commit is contained in:
parent
032219bee2
commit
54fe139a46
3 changed files with 39 additions and 2 deletions
|
|
@ -37,5 +37,5 @@ ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
|
||||||
CMD [ "sleep", "infinity" ]
|
CMD [ "sleep", "infinity" ]
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional OS packages.
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
&& apt-get -y install --no-install-recommends make
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -73,3 +73,6 @@ $RECYCLE.BIN/
|
||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux
|
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux
|
||||||
|
|
||||||
|
# Custom dir for test
|
||||||
|
tests/
|
||||||
|
|
|
||||||
34
Makefile
Normal file
34
Makefile
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
CMD = /usr/bin/docker
|
||||||
|
IMAGE = mogeko/qbittorrent
|
||||||
|
VERSION = 4.3.8
|
||||||
|
PORT = 8080
|
||||||
|
CONF_DIR = $(shell pwd)/tests/config
|
||||||
|
DL_DIR = $(shell pwd)/tests/data
|
||||||
|
|
||||||
|
.PHONY: all build run help
|
||||||
|
|
||||||
|
all: build run
|
||||||
|
|
||||||
|
build:
|
||||||
|
@$(CMD) build . \
|
||||||
|
--build-arg VERSION=$(VERSION) \
|
||||||
|
--tag $(IMAGE)
|
||||||
|
|
||||||
|
run: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ")
|
||||||
|
run:
|
||||||
|
@-$(CMD) run -it \
|
||||||
|
--name qbt-$(id) \
|
||||||
|
-p 6881:6881 \
|
||||||
|
-p 6881:6881/udp \
|
||||||
|
-p $(PORT):8080 \
|
||||||
|
-v $(CONF_DIR):/config \
|
||||||
|
-v $(DL_DIR):/downloads \
|
||||||
|
$(IMAGE)
|
||||||
|
@$(CMD) rm -f qbt-$(id)
|
||||||
|
|
||||||
|
help: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ")
|
||||||
|
help:
|
||||||
|
@-$(CMD) run -it --name qbt-$(id) $(IMAGE) --help
|
||||||
|
@$(CMD) rm -f qbt-$(id)
|
||||||
|
|
||||||
|
rm: clean
|
||||||
Loading…
Add table
Reference in a new issue