From 55951b7a5555c7afcd62aee9e73697b044afc8c0 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 7 Aug 2018 18:21:52 +0000 Subject: [PATCH] Start trying to dockerize --- Dockerfile | 9 +++++++++ Makefile | 21 +++++++++++++-------- go.sh | 9 +++++++++ run-tanks => round.sh | 0 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 Dockerfile create mode 100644 go.sh rename run-tanks => round.sh (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..24b2545 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine AS builder + +RUN apk --no-cache add build-base +COPY . /src +RUN make -C /src DESTDIR=/tanks install + +FROM neale/eris +COPY builder:/opt/tanks /tanks +CMD [ "/opt/tanks/go.sh" ] diff --git a/Makefile b/Makefile index 9b9400f..8f02296 100644 --- a/Makefile +++ b/Makefile @@ -4,18 +4,23 @@ WWW = style.css grunge.png designer.js figures.js tanks.js nav.html.inc jstanks. CFLAGS = -Wall +DESTDIR = /opt/tanks + all: $(BINARIES) $(HTML) install: - install -d $(DESTDIR)/usr/bin - install run-tanks $(DESTDIR)/usr/bin - install forftanks $(DESTDIR)/usr/bin + install -d $(DESTDIR)/bin + install go.sh $(DESTDIR)/bin + install round.sh $(DESTDIR)/bin + install forftanks $(DESTDIR)/bin - install -d $(DESTDIR)/usr/lib/tanks - install designer.cgi $(DESTDIR)/usr/lib/tanks - install $(HTML) $(DESTDIR)/usr/lib/tanks - install $(WWW) $(DESTDIR)/usr/lib/tanks - cp -r examples $(DESTDIR)/usr/lib/tanks/examples + install -d $(DESTDIR)/www + install designer.cgi $(DESTDIR)/www + install $(HTML) $(DESTDIR)/www + install $(WWW) $(DESTDIR)/www + + install -d $(DESTDIR)/examples + cp -r examples $(DESTDIR)/examples forftanks: forftanks.o ctanks.o forf.o forftanks: LDLIBS = -lm diff --git a/go.sh b/go.sh new file mode 100644 index 0000000..64b5208 --- /dev/null +++ b/go.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +( + cd /tanks/www + s6-tcpserver -u 80 -g 80 0.0.0.0 80 /usr/bin/eris -c -. +) & + +( + cd diff --git a/run-tanks b/round.sh similarity index 100% rename from run-tanks rename to round.sh