Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2016 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/fb2f745aab394e686e6e0566082d3276 to your computer and use it in GitHub Desktop.
Save anonymous/fb2f745aab394e686e6e0566082d3276 to your computer and use it in GitHub Desktop.
vyosbuild Dockerfile and helper script
#!/bin/bash
function usage {
cat <<EOT
Usage: vyos-build-iso <branch>
where:
<branch> := [ lithium | helium | hydrogen ]
EOT
exit
}
function build_iso {
echo "building iso for branch: $branch"
cd /data/build-iso
git pull
git branch | grep -q "$branch" || (
git branch $branch --track origin/$branch
git checkout $branch
)
export PATH=/sbin:/usr/sbin:$PATH
autoreconf -i
./configure
make iso
mkdir -p "/data/output/$branch"
cp /data/build-iso/livecd/VyOS-*.iso "/data/output/$branch"
}
branch=$1
[[ $branch == "" ]] && usage
build_iso "$branch"
FROM debian:squeeze
MAINTAINER Chris Bennett <chris@ceegeebee.com>
ENV PATH="/data/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
RUN apt-get -y install debian-archive-keyring
RUN echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list; \
apt-get update; \
apt-get -t squeeze-backports -y install squashfs-tools
RUN apt-get -y install git autoconf automake dpkg-dev live-helper syslinux genisoimage
# needed for vyos build in docker debian:squeeze
RUN apt-get -y install lsb-release
# used while image still in dev
RUN apt-get -y install vim
RUN mkdir -p /data; cd /data; git clone https://github.com/vyos/build-iso.git
RUN mkdir -p /data/bin
ADD bin/vyos-build-iso /data/bin/vyos-build-iso
WORKDIR /data/build-iso
CMD ["/data/bin/vyos-build-iso"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment