aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Mortier <mort@cantab.net>2019-03-01 16:16:21 +0000
committerRichard Mortier <mort@cantab.net>2019-03-01 16:16:21 +0000
commit22f9c95fa64c24d8d7a693535b101508defc782c (patch)
treef171451214e590808fe957da55d482b5f1e5d4de
parent44330f8d84dfcb32f4a1172146898cd855b01a3b (diff)
downloaddocker-abuild-22f9c95fa64c24d8d7a693535b101508defc782c.tar.bz2
docker-abuild-22f9c95fa64c24d8d7a693535b101508defc782c.tar.xz
image: first cut at image configuration
Signed-off-by: Richard Mortier <mort@cantab.net>
-rw-r--r--.dockerignore2
-rw-r--r--Dockerfile17
-rwxr-xr-xentrypoint.sh15
3 files changed, 34 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..4f319eb
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+Makefile
+abuild
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..6c97f42
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,17 @@
+FROM alpine:edge
+MAINTAINER Richard Mortier <mort@cantab.net>
+
+RUN apk add --update-cache \
+ alpine-conf \
+ alpine-sdk \
+ && setup-apkcache /var/cache/apk
+
+RUN adduser -D builder \
+ && addgroup builder abuild \
+ && echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
+
+COPY entrypoint.sh /home/builder
+
+USER builder
+WORKDIR /cwd
+ENTRYPOINT ["/home/builder/entrypoint.sh"]
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100755
index 0000000..9df66a9
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+## debug
+if [ "$DOCKER_ABUILD_DEBUG" = "true" ]; then
+ set -x
+ PS4='$LINENO: '
+fi
+
+if [ ! -r "$HOME/.abuild/abuild.conf" ]; then
+ abuild-keygen -n -i -a
+fi
+
+abuild "$@"