-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 696 Bytes
/
Makefile
File metadata and controls
43 lines (31 loc) · 696 Bytes
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
SHELL=/bin/bash
usage=make <target> account=<docker account> image=<docker image> tag=<docker tag>
include .env
ifndef account
override account = default_account
endif
ifndef image
override image = default_image_name
endif
ifndef tag
override tag = latest
endif
ifndef port
override port = 22
endif
build:
docker build \
--build-arg port="$(port)" \
--no-cache=true -t $(image) .
tag:
docker tag $(image) $(account)/$(image):$(tag)
push: tag
docker push $(account)/$(image):$(tag)
run:
docker run -it -p $(port):$(port) $(image) bash
ssh: clean
mkdir -p ssh
ssh-keygen -t rsa -b 4096 -C "$(email)" -f ./ssh/id_rsa -q -N ""
chmod 400 ./ssh/id_rsa
clean:
rm -rf ssh/id_rsa*