-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (30 loc) · 1.05 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
# https://github.com/jmkhael/make-for-docker
include make_env
NS ?= act28
VERSION ?= latest
IMAGE_NAME ?= openvpn-proxy
CONTAINER_NAME ?= work
CONTAINER_INSTANCE ?= default
OPTS ?= \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
--dns=1.1.1.1 --dns=9.9.9.9 \
--restart=always
.PHONY: build push shell run start stop rm release
build: Dockerfile
docker build -t $(NS)/$(IMAGE_NAME):$(VERSION) -f Dockerfile .
push:
docker push $(NS)/$(IMAGE_NAME):$(VERSION)
shell:
docker run --rm --name $(CONTAINER_NAME)-$(CONTAINER_INSTANCE) -i -t $(OPTS) $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(IMAGE_NAME):$(VERSION) /bin/bash
run:
docker run --rm --name $(CONTAINER_NAME)-$(CONTAINER_INSTANCE) $(OPTS) $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(IMAGE_NAME):$(VERSION)
start:
docker run -d --name $(CONTAINER_NAME)-$(CONTAINER_INSTANCE) $(OPTS) $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(IMAGE_NAME):$(VERSION)
stop:
docker stop $(CONTAINER_NAME)-$(CONTAINER_INSTANCE)
rm:
docker rm $(CONTAINER_NAME)-$(CONTAINER_INSTANCE)
release: build
make push -e VERSION=$(VERSION)
default: build