Skip to content

Commit 0c6b0b2

Browse files
committed
Containerfile: Add
1 parent 8d87f11 commit 0c6b0b2

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

Containerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Using www.github.com/wtfbbqhax/krakatoa
2+
FROM arm64v8/krakatoa AS libpacket_dev_env
3+
4+
USER root
5+
RUN apk update
6+
7+
VOLUME /volume/libpacket
8+
WORKDIR /volume/libpacket
9+
10+
RUN apk add \
11+
libdaq-dev@local \
12+
libdaq-pcap-module@local \
13+
libdaq-dump-module@local
14+
15+
RUN apk add \
16+
build-base \
17+
cmake \
18+
ninja \
19+
gtest-dev
20+
21+
RUN echo alias vi=nvim > /root/.profile
22+
23+
RUN apk add neovim tmux ctags

Makefile

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1-
.PHONY: build clean install test uninstall
1+
.DEFAULT_GOAL := build
22

3+
# Makefile rules to build the libpacket source code
4+
.PHONY: build
35
build:
46
cmake -B build -G Ninja . \
57
-D CMAKE_BUILD_TYPE:STRING=Debug \
68
-D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
79
cmake --build build
810

9-
clean:
10-
rm -rf build/
11-
11+
.PHONY: install
1212
install: build
1313
cmake --install build
1414

15+
.PHONY: clean
16+
clean:
17+
rm -rf build/
18+
19+
.PHONY: test
1520
test: install
1621
make -C tests/
1722

23+
.PHONY: uninstall
1824
uninstall:
1925
rm -f /usr/local/include/packet.h
2026
rm -rf /usr/local/include/packet/
2127
rm -f /usr/local/lib/libpacket.so.*
2228
rm -f /usr/local/lib/libpacket.so
29+
30+
# Makefile rules to build the libpacket development environment.
31+
#
32+
# If you have a working Docker environment, you can use and contribute to this
33+
# code base.
34+
IMAGE_NAME=wtfbbqhax/libpacket
35+
36+
.PHONY: container
37+
container:
38+
docker build . -f Containerfile -t $(IMAGE_NAME)
39+
40+
.PHONY: start
41+
start:
42+
docker run --rm -td -v "$(PWD)":/volume/libpacket "$(IMAGE_NAME)"
43+
44+
.PHONY: kill
45+
kill:
46+
docker kill $(shell docker ps --filter "ancestor=$(IMAGE_NAME)" --format "{{.ID}}")
47+
48+
.PHONY: attach
49+
attach:
50+
docker exec -ti $(shell docker ps --filter "ancestor=$(IMAGE_NAME)" --format "{{.ID}}" | head -n1) sh
51+

0 commit comments

Comments
 (0)