aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dockerize
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2015-11-04 15:00:49 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2015-11-10 07:34:40 +0000
commit86a8e9bc5a7d65784c3b6facd9ce3785d67debc5 (patch)
tree53b1643a1586a688bbe75e83996fad585465ce0f /testing/dockerize
parent72e6339169f05936ef120d629d05743f6291c479 (diff)
downloadaports-86a8e9bc5a7d65784c3b6facd9ce3785d67debc5.tar.bz2
aports-86a8e9bc5a7d65784c3b6facd9ce3785d67debc5.tar.xz
testing/dockerize: new aport
https://github.com/jwilder/dockerize Utility to simplify running applications in docker containers.
Diffstat (limited to 'testing/dockerize')
-rw-r--r--testing/dockerize/APKBUILD86
1 files changed, 86 insertions, 0 deletions
diff --git a/testing/dockerize/APKBUILD b/testing/dockerize/APKBUILD
new file mode 100644
index 0000000000..3fbc5b141b
--- /dev/null
+++ b/testing/dockerize/APKBUILD
@@ -0,0 +1,86 @@
+# Maintainer: Christian Kampka <christian@kampka.net>
+pkgname=dockerize
+pkgver=0.0.4
+pkgrel=0
+pkgdesc="Utility to simplify running applications in docker containers."
+url="https://github.com/jwilder/dockerize"
+arch="x86 x86_64"
+license="MIT"
+makedepends="git go"
+options="!strip"
+source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar"
+
+_giturl="git://github.com/jwilder/${pkgname}.git"
+_disturl="dev.alpinelinux.org:/archive/$pkgname/"
+
+
+snapshot() {
+ abuild clean
+ abuild deps
+
+ mkdir -p "$srcdir"
+ cd "$srcdir"
+
+ # dockerize utilizes glock for dependency resolution,
+ # but we don't want to provide glock as a package since
+ # it does not do stable releases.
+ # Therefore, we build it here to resolve the dependencies
+ # for the dockerize snapshot.
+ _glock_giturl="git://github.com/robfig/glock.git"
+ _glock_commit="cb3c3ec56de988289cab7bbd284eddc04dfee6c9"
+
+ export GOPATH="${srcdir}/glock"
+ git clone -q ${_glock_giturl} || return 1
+ cd "${srcdir}/glock"
+ git checkout -q ${_glock_commit} || return 1
+ go get -v -d || return 1
+ go build || return 1
+ GLOCK_BIN="${srcdir}/glock/glock"
+
+ # now prepare the dockerize snapshot
+
+ cd "$srcdir"
+ msg "Creating snapshot: $_pkg"
+ export GOPATH="${srcdir}/$pkgname"
+ git clone -q ${_giturl} ${pkgname}|| return 1
+ cd $pkgname
+ git checkout -q v${pkgver} || return 1
+ "$GLOCK_BIN" sync ../ || return 1
+ cd $srcdir
+ tar cf $pkgname-$pkgver.tar $pkgname || return 1
+ rsync --progress -La $pkgname-${pkgver}.tar \
+ $_disturl || return 1
+ cd $startdir
+ abuild checksum
+ abuild undeps
+}
+
+_builddir="${srcdir}/${pkgname}"
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ GOARCH=$(go env | grep GOARCH | cut -d'=' -f 2 | xargs echo -n)
+ export GOPATH="$_builddir"
+ mkdir -p ${_builddir}/dist/linux/$GOARCH
+ GOOS=linux go build -ldflags "-X main.buildVersion ${pkgver}" -o ${_builddir}/dist/linux/$GOARCH/dockerize
+}
+
+package() {
+ cd "$_builddir"
+ GOARCH=$(go env | grep GOARCH | cut -d'=' -f 2 | xargs echo -n)
+ install -Dm755 ${_builddir}/dist/linux/$GOARCH/dockerize \
+ "$pkgdir"/usr/bin/dockerize
+}
+md5sums="71e47581580baf185c61ee29e6c5bb59 dockerize-0.0.4.tar"
+sha256sums="afe7a6426f06e9e3327ccff808da8d3b5f1cc28fe1c368346de459b4364733c8 dockerize-0.0.4.tar"
+sha512sums="d03e7473de5cbc366a975430a7b9673edce473ef0d79baf41e656da2bb9c7c2f52b76bb48037591b5e62273dd59470d0d6e9e121cf0883ace0efb926f5a81757 dockerize-0.0.4.tar"