Skip to content

Instantly share code, notes, and snippets.

@inaz2

inaz2/build-image.sh

Last active Dec 9, 2015
Embed
What would you like to do?
Build scripts for docker images inaz2/debian-armel etc.
#!/bin/bash
set -e
ARCHS="armel armhf arm64 powerpc s390x"
apt-get update
apt-get -y install debootstrap qemu-user-static
for arch in $ARCHS; do
qemu-debootstrap --verbose --arch=$arch --variant=buildd --include=gdb,vim-tiny,less jessie rootfs-debian-$arch http://ftp.jp.debian.org/debian/
cat <<__EOF__ >rootfs-debian-$arch/etc/apt/sources.list
deb http://httpredir.debian.org/debian jessie main
deb http://httpredir.debian.org/debian jessie-updates main
deb http://security.debian.org jessie/updates main
__EOF__
chroot rootfs-debian-$arch apt-get update
chroot rootfs-debian-$arch apt-get -y upgrade
chroot rootfs-debian-$arch apt-get clean
tar --numeric-owner --create --directory rootfs-debian-$arch/ . | sudo docker import - inaz2/debian-$arch:jessie
docker tag inaz2/debian-$arch:jessie inaz2/debian-$arch:latest
docker tag inaz2/debian-$arch:jessie inaz2/debian-$arch:8.2
rm -rf rootfs-debian-$arch
done
#!/bin/bash
set -e
ARCHS="armel armhf arm64 powerpc s390x"
for arch in $ARCHS; do
docker push inaz2/debian-$arch
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment