How to Create a Custom Ubuntu Server Image?

0
0
Asked By CuriousCat42 On

I'm looking to create a custom Ubuntu Server image but I'm struggling to find a comprehensive guide. Canonical doesn't seem to have a complete resource for this. I've come across several discussions about setting up an autoinstall file for cloud-init, but I'm unsure how to implement all the changes I need. My goals include adding a Docker repository, installing Docker CE directly on the image, ensuring the install runs without prompts, rebooting once completed, including a custom Docker image, applying all current updates, specifying a unique location for SSH keys that's neither GitHub nor Launchpad, and modifying the grub.conf in the final image. I'm also sharing this on another forum, but I don't want it to get buried under beginner questions.

5 Answers

Answered By OldSchoolDev70 On

Fifteen years ago, I used debootstrap in a chroot environment for creating Xen images. More recently, I’ve transitioned to using Packer, but not sure if that's the best current method.

Answered By PackerPro On

You might want to look into using Packer for your needs. It’s designed for creating machine images across various platforms and might simplify your workflow.

Answered By TechWhiz99 On

From what I've seen, it's often best to keep customization of the image minimal. In my setup, I use cloud-init to add my Ansible user (with sudo access), install OpenSSH, lldpd, and the puppet agent. After that, everything else is managed by my central config management system, like Ansible or Puppet. Cloud-init is useful but has a specific order to its operations that can't be changed, which sometimes causes issues if you try to overcomplicate it. If you already have a config management tool, it can handle things like Docker installation much more smoothly.

Answered By ScriptMaster88 On

If you want complete customization, I recommend Cubic. It allows you to modify any Ubuntu ISO quite extensively. You can check it out at the GitHub link I provided.

Answered By LinuxGuru81 On

Have you considered creating a template? Start with a full installation, customize it to your liking, and then use something like virt-sysprep. This way, you can launch the template without conflicts. I still recommend incorporating cloud-init for networking and initial install updates.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.