Simple build system for ocaml-based iptables

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
Ian Campbell 2016-06-17 11:56:57 +01:00 committed by David Scott
parent bf1a0e0011
commit 0c471bdc09
5 changed files with 19 additions and 0 deletions

View File

@ -75,6 +75,7 @@ COPY packages/9pmount-vsock/9pmount-vsock /sbin
COPY packages/test/etc /etc
COPY packages/test/mobytest /usr/bin
COPY packages/sysctl/etc /etc
COPY packages/iptables/iptables /usr/local/sbin/iptables
RUN \
rc-update add swap boot && \

View File

@ -10,6 +10,7 @@ all:
$(MAKE) -C llmnrd OS=linux
$(MAKE) -C gummiboot OS=linux
$(MAKE) -C 9pmount-vsock OS=linux
$(MAKE) -C iptables OS=linux
arm:
$(MAKE) -C transfused OS=linux ARCH=arm
@ -33,3 +34,4 @@ clean:
$(MAKE) -C llmnrd clean
$(MAKE) -C gummiboot clean
$(MAKE) -C 9pmount-vsock clean
$(MAKE) -C iptables clean

View File

@ -0,0 +1,5 @@
FROM ocaml/opam:alpine
WORKDIR /app
ADD . /app
RUN sudo chown -R opam /app
RUN ocamlopt -o iptables main.ml

View File

@ -0,0 +1,9 @@
all: iptables
iptables: Dockerfile main.ml
docker build -t iptables:build .
docker run --rm iptables:build cat /app/iptables > iptables
chmod 755 iptables
clean:
docker images -q iptables:build | xargs docker rmi -f || true

View File

@ -0,0 +1,2 @@
let () =
print_string "Hello world!\n";;