From e92420af86769c04f30000cc8b5de74f700a8821 Mon Sep 17 00:00:00 2001 From: Justin Dray Date: Sun, 7 Jun 2015 22:43:23 +1000 Subject: [PATCH] Initial commit --- Dockerfile | 12 ++++++++++++ LICENSE.md | 21 +++++++++++++++++++++ README.md | 3 +++ run.sh | 9 +++++++++ sudoers | 2 ++ 5 files changed, 47 insertions(+) create mode 100644 Dockerfile create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 run.sh create mode 100644 sudoers diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4117bb7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM justin8/archlinux +MAINTAINER justin@dray.be + +RUN mkdir -p /build +WORKDIR /build +RUN pacman -Syuq --noconfirm --needed base-devel && rm -rf /var/cache/pacman/pkg/* +ADD sudoers /etc/sudoers +ADD run.sh /run.sh + +VOLUME "/src" + +ENTRYPOINT ["/run.sh"] diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..584bf89 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Justin Dray + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..14c736f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +This is a docker image for building Arch Linux packages in a clean container + +Bind a location with a PKGBUILD to /src and it will output the package. passing 'update' to it will run a pacman -Syu beforehand for building C and other projects that depend on upstream libraries that can change. diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..b318c7f --- /dev/null +++ b/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -x + +cp /src/* /build +chown -R nobody. /build +[[ $1 == update ]] && pacman -Syu || pacman -Sy + +su nobody -s /bin/bash -c "makepkg -fs --noconfirm" +cp /build/*pkg.tar* /src diff --git a/sudoers b/sudoers new file mode 100644 index 0000000..d544918 --- /dev/null +++ b/sudoers @@ -0,0 +1,2 @@ +root ALL=(ALL) ALL +nobody ALL=(ALL) NOPASSWD: ALL