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!
This commit is contained in:
Martin Kennedy 2021-02-06 21:47:58 +00:00
commit fc6902981c
6 changed files with 87 additions and 0 deletions

11
Makefile Normal file
View File

@ -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 $@;

8
builder-entry.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
chown buildbot:buildbot /builder
cd /builder
/usr/sbin/gosu buildbot /usr/bin/screen "$@"

7
builder-start.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
[ -x /input.sh ] && /input.sh
/bin/bash
[ -x /output.sh ] && /output.sh

43
builder.dockerfile Normal file
View File

@ -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" ]

View File

@ -0,0 +1,9 @@
FROM openwrt-builder
ARG commit
RUN git pull origin master
RUN git checkout ${commit}

View File

@ -0,0 +1,9 @@
FROM builder
USER buildbot
WORKDIR /builder/openwrt
RUN git clone https://git.laboratoryb.org/hurricos/openwrt-mirror --branch master .