Giter VIP home page Giter VIP logo

crocodile's Introduction

Crocodile

The Crocodile repository contains everything that a user should need in order to build Windows{x} compressed raw images for tinkerbell.

Note: These images are for the Community and are not part of Equinix Metal Operating System Images.

The repository contains a number of key pieces:

Dockerfile

The Dockerfile contains everything that is needed to build a docker container with everything that is needed to build the Operating System images:

  • Packer
  • Qemu-kvm
  • virtio drivers (needed for Qemu to work with disks)

Host requirements

Minimal

For most OS image builds, all you should really need is Docker on a reasonably modern Linux distro with KVM virtualization support. *Ubuntu docker hosts may need to reboot after ensuring that libvirt-daemon-system is installed prior to running crocodile.

ESXi special requirements

To build ESXi images we depend on special bridged networking provided by libvirt-daemon. To confirm expected bridged networking, ip link show virbr0 should succeed. You will also need to add `--device=/dev/net/tun --cap-add=NET_ADMIN" to your docker commands.

Building our container image

docker build -t croc .

This will take a few mins (depending on the speed of the connection to the internet), and you'll be left with a docker image called croc:latest

Running our croc container

Our newly built croc container can work in two ways, either interactive or can be fully automated.

We will map two directories into our running container:

-v $PWD/packer_cache:/packer/packer_cache - Maps the packer_cache to a local packer_cache folder, this stops ISOs repeatedly downloading.

-v $PWD/images:/var/tmp/images - Maps a local images folder to where the images will be created.

Ubuntu docker hosts may also require the following additional options:

--privileged -it --rm -v $PWD/packer_cache:/packer/packer_cache -v $PWD/images:/var/tmp/images -v /dev/net:/dev/net

Interactive

Without passing anything specific to the container it will default to starting the interactive image building process.

docker run -it --rm \
-v $PWD/packer_cache:/packer/packer_cache \
-v $PWD/images:/var/tmp/images \
--net=host \
--device=/dev/kvm \
croc:latest

This will drop you into the crocodile shell for building your OS:

                          .--.  .--.
                         /    \/    \
                        | .-.  .-.   \
                        |/_  |/_  |   \
                        || `\|| `\|    `----.
                        |\0_/ \0_/    --,    \_
      .--"""""-.       /              (` \     `-.
     /          \-----'-.              \          \
     \  () ()                         /`\          \
     |                         .___.-'   |          \
     \                        /` \|      /           ;
      `-.___             ___.' .-.`.---.|             \
         \| ``-..___,.-'`\| / /   /     |              `\
          `      \|      ,`/ /   /   ,  /
                  `      |\ /   /    |\/
                   ,   .'`-;   '     \/
              ,    |\-'  .'   ,   .-'`
            .-|\--;`` .-'     |\.'
           ( `"'-.|\ (___,.--'`'
            `-.    `"`          _.--'
               `.          _.-'`-.
                 `''---''``       `."
Select quit (1)  when you've finished building Operating Systems
1) quit		   4) esxi6.5	     7) ubuntu-2004   10) windows-2016
2) alma		   5) esxi6.7	     8) windows-10    11) windows-2019
3) arch		   6) esxi7.0	     9) windows-2012

Troubleshooting

In the event that a build is failing then we can debug the issue by adding -e PACKER_LOG=1 to the docker run command.

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.