forked from igroff/forkulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (50 loc) · 1.21 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
48
49
50
51
52
53
54
55
56
SHELL:=/usr/bin/env bash -euo pipefail -c
NAME:=forkulator
LABEL:=$(NAME):latest
main:
echo $(LABEL)
@>&2 echo "no supported default option"; false
build:
# https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
# https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/
DOCKER_BUILDKIT=1 \
docker build \
--tag "$(LABEL)" \
.
# attach to the running debug instance
shell:
docker exec \
--interactive \
--tty \
"$(NAME)" \
"/bin/bash"
# run the container using only the shell
run-shell:
docker run \
--interactive \
--tty \
--rm \
--env DEBUG=true \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env AWS_SECURITY_TOKEN \
--volume "$(shell pwd)/../forkulator-commands:/forkulator/commands:ro" \
--entrypoint '' \
"$(NAME)" \
"/bin/bash"
debug: build
# LOCAL_PORT:CONTAINER_PORT
docker run \
--interactive \
--tty \
--rm \
--env FORKULATOR_TEMP=/tmp \
--env DEBUG=true \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env AWS_SECURITY_TOKEN \
--name "$(NAME)" \
--publish 9000:3000 \
--volume "$(shell pwd)/../forkulator-commands:/forkulator/commands:ro" \
"$(LABEL)"
.PHONY: main build shell run-shell debug