GithubHelp home page GithubHelp logo

image-builder's Introduction

image-builder

Build images of various OSes (actually just ubuntu bionic) with pre-installed software (actually just docker).

Building different flavors of images

Open a branch called something/fix and the system will create an image called imgbuild-something_fix.qcow2.tar.gzon the shared host volume /opt/volumes/vmck-images using packer-build/ubuntu1804.json as configuration. You can modify packer-build/ubuntu1804.json to suit your needs.

On the master branch we're installing Docker on Ubuntu Bionic.

Building an image locally

Requirements:

sudo apt install qemu qemu-kvm

Install packer by following the instructions.

Building your image:

./packer-build/build.sh ${PACKER_CONFIGURATION} --option vm_name=${VM_NAME}

This will build a vm using the given ${PACKER_CONFIGURATION} with the name ${VM_NAME} in packer-build/build. If you don't want to build a configuration from scratch, just modify the install script packer-build/install.sh.

  • To choose what software to be installed modify provisioners.inline.
  • To change the disk size modify builders.disk_size

Start your image

./packer-build/start.sh ${VM_NAME}.qcow2 --ssh ${PORT} --detached --safe

It will start the image with the name ${VM_NAME}.qcow2 located in packer-build/build and allows you to connect with ssh on port ${PORT}.

  • --ssh ${PORT} (optional) forwards ssh port from vm to the given ${PORT} argument
  • --detached (optional) start qemu in daemmonized form, not locking your terminal
  • --safe (optional) create image that refers to an original image using Redirect-on-Write to avoid changing the original image.

The username is vagrant and password is vagrant.

Toubleshooting

If you get the error: Could not access KVM kernel module: Permission denied, add your user to the libvirtd group as explained here: https://wiki.alpinelinux.org/wiki/KVM on alpine or to the kvm group on Debian-based distros. If it continues:

sudo chmod 666 /dev/kvm

image-builder's People

Contributors

gabriel-v avatar dibiex avatar jokeswar avatar gmuraru avatar dorinelfilip avatar

Watchers

James Cloos avatar

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.