Giter VIP home page Giter VIP logo

Comments (4)

tylert avatar tylert commented on June 4, 2024

That's quite the large collection of requirements...

Getting started is pretty easy if you have http://brew.sh/ installed...

brew install packer

I use Packer on Mac OSX and Linux with VirtualBox on both and qemu on Linux. If you're trying to get qemu working, you'll probably want to consider setting yourself up a Linux machine on a spare x86_64 machine.

Something to remember... Vagrant box files are tar.gz archives containing: box.ovf, name_of_machine-disk1.vmdk, Vagrantfile, metadata.json and OVA files are tar archives containing the same box.ovf file renamed to name_of_machine.ovf and the same vmdk file. The qemu-img convert can be used to convert the vmdk file to a qemu raw file but I haven't tested it yet.

I haven't touched Windows for nearly 2 decades now so I won't be able to help you there. Perhaps you should do a search for packer Windows projects on GitHub (I know there are a few).

You won't be able to boot your Raspberry Pi from USB but you can put your root filesystem there and boot from uSD or SD. If all you want to do is make sure you have the same software on there, there are other ways of doing that.

I have starred a few Raspberry Pi image builder GitHub projects with the intention of eventually building my own images from scratch to add a few packages. The idea that you are suggesting trying to make non-bootable root filesystems for Raspberry Pi using Packer is something I have also considered trying.

I'll try to answer a bit more when I have some more time.

from packer-build.

tylert avatar tylert commented on June 4, 2024

Doing the Ubuntu server build will be very easy to generate both a qemu and vagrant image using the same template--I do this already in my packer templates.

I just added a Xenial Xerus template for you to try. I haven't tested it yet but I'm pretty confident it's mostly ok. You'd likely just change one line d-i pkgsel/include string openssh-server, postgresql to add another entry to the package list in the base-64.seed file or else apt-get install postgresql sometime later (in another shell provisioner perhaps).

As for adding Go, you'd probably want to grab a more recent binary rather than use the old crufty one packaged in Ubuntu. I just added a similar thing for packer in their vagrant file recently. It basically is just does (using sudo)...

# Fetch from https://golang.org/dl
TARBALL="https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz"

UNTARPATH="/opt"
GOROOT="${UNTARPATH}/go"
GOPATH="${UNTARPATH}/gopath"

# Install Go
if [ ! -d ${GOROOT} ]; then
  sudo wget --progress=bar:force --output-document - ${TARBALL} |\
    tar xfz - -C ${UNTARPATH}
fi

# Setup the GOPATH
sudo mkdir -p ${GOPATH}
cat <<EOF >/tmp/gopath.sh
export GOROOT="${GOROOT}"
export GOPATH="${GOPATH}"
export PATH="${GOROOT}/bin:${GOPATH}/bin:\$PATH"
EOF
sudo mv /tmp/gopath.sh /etc/profile.d/gopath.sh

from packer-build.

tylert avatar tylert commented on June 4, 2024

The more I think about it, I think the Raspberry Pi stuff is going to likely require a totally different toolchain and build environment.

I'd just build your Raspberry Pi images using something designed for building such images such as one of the following projects:

from packer-build.

joeblew99 avatar joeblew99 commented on June 4, 2024

Thanks for the hugely thorough answer.

Ubuntu Core is my favourite target for an OS. I am working on Snaps etc, and also the Transactional OS updates stuff in a vagrant machine.

I was thinking about this, and there are really two fundamental approaches:
1 - try to build images with all the stuff you need in them, and BURN it
2 - just boot the OS, and have a script to install the other bits.

Your seed file looks pretty cool.

About getting a Linux box in order to do QEMU. Yep makes sense. I saw some googlings about running QEMU on OSX, but have not tried yet.

I will play around and see how far i get.

from packer-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.