From 7205f494eb1162fcd57af7d76b162c330069947a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 10 Mar 2015 15:18:38 +0000 Subject: [PATCH] Pull latest files from Gorka's repo --- Dockerfile | 4 ++-- rootfs/build-latest | 48 ++++++++++++++++++++++++++++---------------- rootfs/build-wrapper | 4 ++++ 3 files changed, 37 insertions(+), 19 deletions(-) mode change 100644 => 100755 rootfs/build-latest create mode 100755 rootfs/build-wrapper diff --git a/Dockerfile b/Dockerfile index 272b225..7e29691 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y curl COPY rootfs / -RUN chmod +x /build-latest +RUN chmod +x /build-* ENV OVERLAY_ROOTFS_PATH /overlay-rootfs COPY overlay-rootfs $OVERLAY_ROOTFS_PATH -CMD [ "/build-latest" ] +CMD [ "/build-wrapper" ] diff --git a/rootfs/build-latest b/rootfs/build-latest old mode 100644 new mode 100755 index 605c26e..d601da8 --- a/rootfs/build-latest +++ b/rootfs/build-latest @@ -1,11 +1,13 @@ -#!/bin/bash +#!/usr/bin/env bash +set -e +set -x ## ## PARAMS ## OVERLAY_ROOTFS_PATH=${1:-/overlay-rootfs} -RELEASE_VERSION=${2:-1.5.0} +RELEASE_VERSION=${2:-1.6.0} outputs=( linux @@ -51,8 +53,10 @@ for package in "${packages[@]}"; do curl -R -L -O https://github.com/just-containers/skaware-builder/releases/download/v$RELEASE_VERSION/$file done -# fix-attrs -curl -R -L -o /tmp/fix-attrs https://github.com/glerchundi/fix-attrs/releases/download/v0.4.0/fix-attrs-0.4.0-linux-amd64 +# strace (if we want to debug) +if [ -n "$DEBUG" ]; then + curl -R -L -o /tmp/strace http://landley.net/aboriginal/downloads/binaries/extras/strace-x86_64 +fi ## ## OVERLAYS @@ -69,9 +73,6 @@ do # copy overlay files cp -a $OVERLAY_ROOTFS_PATH/. $overlaypath/ - # create cont-init.d directory always - mkdir -p $overlaypath/etc/cont-init.d - # skarnet versions manifest packages=($(get_packages_with_versions_from_manifest "manifest-$output.txt")) @@ -81,19 +82,32 @@ do tar xvfz /tmp/$package-linux-amd64-bin.tar.gz -C $overlaypath done - # install fix-attrs - cp /tmp/fix-attrs $overlaypath/usr/bin/fix-attrs + # create must exist directories + mkdir -p $overlaypath/etc/s6/init/env-stage2 + mkdir -p $overlaypath/etc/{cont-init.d,fix-attrs.d,services.d} + mkdir -p $overlaypath/var/log/{s6-uncaught-logs,s6-fdholderd} + + # copy strace & fix permissions + if [ -n "$DEBUG" ]; then + cp /tmp/strace $overlaypath/usr/bin/strace + chmod 0755 $overlaypath/usr/bin/strace + fi + + # fix fix-attrs perms + chmod 0755 $overlaypath/usr/bin/fix-attrs - # fix perms - chmod +x $overlaypath/init \ - $overlaypath/etc/s6/.s6-svscan/finish \ - $overlaypath/etc/s6/.s6-init/init-stage* \ - $overlaypath/usr/bin/fix-attrs + # fix init perms + chmod 0755 $overlaypath/init + chmod 0755 $overlaypath/etc/s6/init/init-stage* + chmod 0755 $overlaypath/etc/s6/service/.s6-svscan/{crash,finish} + chmod 0755 $overlaypath/etc/s6/service/s6-fdholderd/run + chmod 0755 $overlaypath/etc/s6/service/s6-svscan-log/run - ## - ## DIST! - ## + # fix log folder perms + chmod 2700 $overlaypath/var/log/{s6-uncaught-logs,s6-fdholderd} + chown nobody:nogroup $overlaypath/var/log/{s6-uncaught-logs,s6-fdholderd} + # dist! mkdir -p /dist tar -zcvf /dist/s6-overlay-$RELEASE_VERSION-$output-amd64.tar.gz -C $overlaypath ./ done diff --git a/rootfs/build-wrapper b/rootfs/build-wrapper new file mode 100755 index 0000000..ca4542d --- /dev/null +++ b/rootfs/build-wrapper @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +rm -f /dist/* +/build-latest 2>&1 | tee "/dist/build-latest-$(date +'%Y%m%d%H%M%S').log"