-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
47 lines (40 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# tftpd Docker Image
.PHONY: help
help:
@echo ""
@echo "Usage: make COMMAND"
@echo ""
@echo "Docker tftpd image makefile"
@echo ""
@echo "Commands:"
@echo " build Build and tag image"
@echo " push Push tagged image to registry"
@echo " run Start container in the background with locally mounted volume"
@echo " stop Stop and remove container running in the background"
@echo " delete Delete all built image versions"
@echo ""
IMAGE=wastrachan/tftpd
TAG=latest
REGISTRY=docker.io
.PHONY: build
build:
@docker build -t ${REGISTRY}/${IMAGE}:${TAG} .
.PHONY: push
push:
@docker push ${REGISTRY}/${IMAGE}:${TAG}
.PHONY: run
run: build
docker run -v "$(CURDIR)/config:/config" \
--name tftpd \
--rm \
-p 69:69/udp \
-e PUID=$$(id -u) \
-e PGID=$$(id -g) \
-d \
${REGISTRY}/${IMAGE}:${TAG}
.PHONY: stop
stop:
@docker stop tftpd
.PHONY: delete
delete:
@docker image ls | grep ${IMAGE} | awk '{print $$3}' | xargs -I + docker rmi +