fix licensing container to fix #70

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-04-05 12:40:26 +01:00
parent 8a8045e03d
commit ae084196bc
2 changed files with 41 additions and 28 deletions

View File

@ -1,6 +1,6 @@
FROM alpine:3.3 FROM alpine:3.3
RUN apk update && apk add lua git RUN apk update && apk add lua git bash
RUN git clone https://github.com/alpinelinux/aports.git RUN git clone https://github.com/alpinelinux/aports.git

View File

@ -1,4 +1,10 @@
#!/bin/sh #!/bin/bash
fail() {
printf $1
printf "\n"
exit 1
}
cat /hostetc/issue | grep -q Moby || ( printf "You must run this script with -v /etc:/hostetc -v /lib:/lib\n" && exit 1 ) cat /hostetc/issue | grep -q Moby || ( printf "You must run this script with -v /etc:/hostetc -v /lib:/lib\n" && exit 1 )
@ -10,22 +16,6 @@ apk info | grep -q fuse || ( printf "You must run this script with -v /etc:/etc
rm -rf /output/* rm -rf /output/*
mkdir -p /output/kernel
cd /output/kernel
cp /proc/config.gz .
wget ${KERNEL_SOURCE=} || ( printf "Failed to download kernel source\n" && exit 1 )
git clone -b "$AUFS_BRANCH" "$AUFS_REPO" /output/kernel/aufs
cd /output/kernel/aufs
git checkout -q "$AUFS_COMMIT"
# to make it easier to check in the output of this script if necessary
rm -rf .git
git clone ${AUFS_TOOLS_REPO} /output/aufs-util
cd /output/aufs-util
git checkout "$AUFS_TOOLS_COMMIT"
rm -rf .git
cd /aports cd /aports
git pull git pull
@ -45,17 +35,40 @@ do
if [ ! -d "$srcdir"/$pkgname-$pkgver ] if [ ! -d "$srcdir"/$pkgname-$pkgver ]
then then
mkdir -p "$srcdir"/$pkgname-$pkgver mkdir -p "$srcdir"/$pkgname-$pkgver
for f in $source while read f
do do
if [ -f $f ] if [ -n "$(echo $f | tr -d '[[:space:]]')" ]
then then
cp -a $f "$srcdir"/$pkgname-$pkgver/ f=$(echo $f | sed 's/^.*:://')
else printf "looking for source for: $f\n"
cd "$srcdir"/$pkgname-$pkgver && \ if [ -f $f ]
wget $f || ( printf "Cannot retrieve $f\n" && exit ) && \ then
cd - cp -a $f "$srcdir"/$pkgname-$pkgver/
fi else
done cd "$srcdir"/$pkgname-$pkgver && \
wget $f || fail "Cannot retrieve $f" && \
cd -
fi
fi
done <<< "$source"
fi fi
) )
done done
mkdir -p /output/kernel
cd /output/kernel
cp /proc/config.gz .
wget ${KERNEL_SOURCE=} || ( printf "Failed to download kernel source\n" && exit 1 )
git clone -b "$AUFS_BRANCH" "$AUFS_REPO" /output/kernel/aufs
cd /output/kernel/aufs
git checkout -q "$AUFS_COMMIT"
# to make it easier to check in the output of this script if necessary
rm -rf .git
git clone ${AUFS_TOOLS_REPO} /output/aufs-util
cd /output/aufs-util
git checkout "$AUFS_TOOLS_COMMIT"
rm -rf .git
printf "All source code now in output/ directory\n'