-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (23 loc) · 1.22 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
MAKEFILE_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
BAKE_SCRIPT:=$(MAKEFILE_DIR)/buildtools/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)
NETWORK?=bridge
ENV?=
BUILD_ARGS?=
RUN_ARGS?=
all: position_trajectory_controller
position_trajectory_controller:
$(BAKE) position-trajectory-controller
# This mybuilder needs the following lines to be run:
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# docker buildx create --name mybuilder
# docker buildx use mybuilder
# docker buildx inspect --bootstrap
local-build-push:
docker buildx bake --builder mybuilder -f $(BAKE_SCRIPT) --push 4pl-controller
run: position_trajectory_controller
docker run -it --rm --net=$(NETWORK) $(ENV) -e USE_SIMULATED_TIME=true $(RUN_ARGS) uobflightlabstarling/position-trajectory-controller:latest
run_bash: position_trajectory_controller
docker run -it --rm --net=$(NETWORK) -e USE_SIMULATED_TIME=true $(RUN_ARGS) uobflightlabstarling/position-trajectory-controller:latest bash
.PHONY: all position_trajectory_controller run run_bash