-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·69 lines (56 loc) · 1.36 KB
/
makefile
File metadata and controls
executable file
·69 lines (56 loc) · 1.36 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env make --file
include makefile.config
-include makefile.config.local
.PHONY: build-% debug-% default logs remove run-% shell start status stop test-% test-code-%
build-%: %/Dockerfile
docker build --force-rm=true --tag=$(registry)$(namespace)/$(image):$*-$(tag) $(buildargs) $(ARGS) $*
debug-%:
docker run \
--hostname=$(name) \
--interactive=true \
--name=$(name) \
--tty=true \
$(runargs) \
$(registry)$(namespace)/$(image):$*-$(tag) \
$(ARGS)
logs:
@docker logs --follow=true $(ARGS) $(name)
remove:
-@docker rm --force=true --volumes=true $(ARGS) $(name)
run-%:
docker run \
--detach=true \
--hostname=$(name) \
--name=$(name) \
--tty=true \
$(runargs) \
$(registry)$(namespace)/$(image):$*-$(tag) \
$(ARGS)
shell:
@docker exec --interactive=true --tty=true $(name) /bin/login -f root -p $(ARGS)
start:
@docker start $(ARGS) $(name)
status:
@docker ps $(ARGS) --all=true --filter=name=$(name)
stop:
-@docker stop $(ARGS) $(name)
test-%: test
docker create \
--name=$(name)-test \
--rm=true \
--tty=true \
$(runargs) \
$(registry)$(namespace)/$(image):$*-$(tag) \
/test \
$(ARGS)
docker cp test $(name)-test:/
docker start --attach=true $(name)-test
test-code-%: %/Dockerfile
@docker run \
--interactive=true \
--rm=true \
hadolint/hadolint:latest-debian \
hadolint \
$(ARGS) \
- \
< $*/Dockerfile