commit fc6902981cdbdbbb8dd478345d61776bc41975e1 Author: Martin Kennedy Date: Sat Feb 6 21:47:58 2021 +0000 Initial setup The point of this is to separate dockerfiles and build them on top of each other wherever possible. Then we can build them interdependently with makefiles! diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a7d3300 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +#.PHONY: built/%.sentinel + +docker_src = /devel/docker +${docker_src}/built/%.sentinel: ${docker_src}/%.dockerfile + grep -e '^FROM' "$*".dockerfile | awk '{print $$2}' \ + | tr : _ | xargs -I{} $(MAKE) ${docker_src}/built/{}.sentinel; + cd ${docker_src}; docker build -f $< --tag $* .; + touch $@; + +${docker_src}/built/debian_10.sentinel: + docker pull "debian:10" && touch $@; diff --git a/builder-entry.sh b/builder-entry.sh new file mode 100644 index 0000000..90c8569 --- /dev/null +++ b/builder-entry.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +chown buildbot:buildbot /builder + +cd /builder + +/usr/sbin/gosu buildbot /usr/bin/screen "$@" + diff --git a/builder-start.sh b/builder-start.sh new file mode 100644 index 0000000..38b1e27 --- /dev/null +++ b/builder-start.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +[ -x /input.sh ] && /input.sh + +/bin/bash + +[ -x /output.sh ] && /output.sh diff --git a/builder.dockerfile b/builder.dockerfile new file mode 100644 index 0000000..960f884 --- /dev/null +++ b/builder.dockerfile @@ -0,0 +1,43 @@ +FROM debian:10 + +ARG DEBIAN_FRONTEND=noninteractive + +USER root + +RUN echo 'deb http://deb.debian.org/debian testing main' \ + > /etc/apt/sources.list.d/testing.list && \ + apt-get update && \ + apt-get install -t buster -y \ + pwgen \ + locales \ + build-essential \ + git-core \ + subversion \ + libncurses5-dev \ + gawk \ + unzip \ + pv \ + gosu \ + signify-openbsd \ + python3 \ + wget \ + curl \ + ccache \ + emacs \ + screen \ + rsync && \ + apt-get clean && \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 + +ENV LANG=en_US.utf8 + +COPY builder-entry.sh /entry.sh +COPY builder-start.sh /start.sh + +RUN mkdir /builder && \ + useradd --home /builder --shell /bin/bash buildbot && \ + chown buildbot:buildbot /builder && \ + chmod 0755 /entry.sh /start.sh + +ENTRYPOINT [ "/entry.sh" ] +CMD [ "/start.sh" ] diff --git a/openwrt-builder-commit.dockerfile b/openwrt-builder-commit.dockerfile new file mode 100644 index 0000000..a5d356f --- /dev/null +++ b/openwrt-builder-commit.dockerfile @@ -0,0 +1,9 @@ +FROM openwrt-builder + +ARG commit + +RUN git pull origin master + +RUN git checkout ${commit} + + diff --git a/openwrt-builder.dockerfile b/openwrt-builder.dockerfile new file mode 100644 index 0000000..b85cba9 --- /dev/null +++ b/openwrt-builder.dockerfile @@ -0,0 +1,9 @@ +FROM builder + +USER buildbot + +WORKDIR /builder/openwrt + +RUN git clone https://git.laboratoryb.org/hurricos/openwrt-mirror --branch master . + +