-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (20 loc) · 1.02 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
MAKEFILE_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
BAKE_SCRIPT:=$(MAKEFILE_DIR)/docker-bake.hcl
BUILDX_HOST_PLATFORM:=$(shell docker buildx inspect default | sed -nE 's/^Platforms: ([^,]*),.*$$/\1/p')
BAKE:=docker buildx bake --builder default --load --set *.platform=$(BUILDX_HOST_PLATFORM) -f $(BAKE_SCRIPT)
CONTAINERNAME?=starling-sim-iris-px4-flightarena
NETWORK?=bridge
ENV?=
PORT?=-p 8080:8080
all: flightarena
flightarena:
$(BAKE) $(CONTAINERNAME) --no-cache
local-build-push:
docker buildx bake --builder mybuilder -f $(BAKE_SCRIPT) --push $(CONTAINERNAME)
run: flightarena
docker run -it --rm --net=$(NETWORK) $(PORT) $(ENV) uobflightlabstarling/$(CONTAINERNAME):latest
run_gimbal: flightarena
docker run -it --rm --net=$(NETWORK) $(PORT) $(ENV) -e SPAWN_GIMBAL=true uobflightlabstarling/$(CONTAINERNAME):latest
run_bash: flightarena
docker run -it --rm --net=$(NETWORK) $(PORT) $(ENV) uobflightlabstarling/$(CONTAINERNAME):latest bash
.PHONY: all flightarena local-build-push run run_bash run_gimbal