forked from NetSys/NetBricks
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker.mk
50 lines (42 loc) · 1.45 KB
/
docker.mk
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
# Docker-specific Makefile for Netbricks Project
# ==============================================
BASE_DIR = $(shell pwd)
SANDBOX ?= williamofockham/sandbox:nightly-2019-10-28
MOUNTS = -v /lib/modules:/lib/modules \
-v /usr/src:/usr/src \
-v /dev/hugepages:/dev/hugepages
.PHONY: pull-sandbox run run-cov run-lint run-tests
pull-sandbox:
@docker pull $(SANDBOX)
run: pull-sandbox
@docker run -it --rm --privileged --network=host \
-w /opt \
$(MOUNTS) \
-v $(BASE_DIR):/opt/netbricks \
-v $(BASE_DIR)/moongen:/opt/moongen \
-e LD_LIBRARY_PATH=/opt/netbricks/target/native:$LD_LIBRARY_PATH \
$(SANDBOX) /bin/bash
run-cov: pull-sandbox
@docker run -it --rm --privileged --network=host \
-w /opt/netbricks \
$(MOUNTS) \
-v $(BASE_DIR):/opt/netbricks \
-v $(BASE_DIR)/moongen:/opt/moongen \
-e LD_LIBRARY_PATH=/opt/netbricks/target/native:$LD_LIBRARY_PATH \
$(SANDBOX) make cov
run-lint: pull-sandbox
@docker run -it --rm --privileged --network=host \
-w /opt/netbricks \
$(MOUNTS) \
-v $(BASE_DIR):/opt/netbricks \
-v $(BASE_DIR)/moongen:/opt/moongen \
-e LD_LIBRARY_PATH=/opt/netbricks/target/native:$LD_LIBRARY_PATH \
$(SANDBOX) make lint
run-tests: pull-sandbox
@docker run -it --rm --privileged --network=host \
-w /opt/netbricks \
$(MOUNTS) \
-v $(BASE_DIR):/opt/netbricks \
-v $(BASE_DIR)/moongen:/opt/moongen \
-e LD_LIBRARY_PATH=/opt/netbricks/target/native:$LD_LIBRARY_PATH \
$(SANDBOX) make test