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 74a7622ee3
commit d118b588c5
5 changed files with 19 additions and 0 deletions

View File

@ -73,6 +73,7 @@ COPY packages/bootflag/bootflag /usr/bin
COPY packages/gummiboot/gummiboot.tar.gz /usr/share/src/
COPY packages/oom/etc /etc
COPY packages/9pmount-vsock/9pmount-vsock /sbin
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";;