Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpine Linux support #1608

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Alpine Linux support #1608

wants to merge 3 commits into from

Conversation

SamuelMarks
Copy link

@SamuelMarks SamuelMarks commented Mar 28, 2025

Description

Add Alpine Linux builds; basically a simple rewrite of the Fedora one

FYI: Testing on macOS (M3) with:

$ gem build bento.gemspec
$ gem install bento-*.gem
$ bento build --cpus 2 os_pkrvars/alpine/alpine-3.21-aarch64.pkrvars.hcl

Related Issue

Closes #1607

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@SamuelMarks SamuelMarks requested review from Stromweld and a team as code owners March 28, 2025 22:58
@SamuelMarks SamuelMarks requested a review from a team as a code owner April 1, 2025 20:10
…ferent virtual machines based on official alpine
Copy link

sonarqubecloud bot commented Apr 7, 2025

@rubisher
Copy link

Hello Samuel,
I was just looking for a support of Alpine in Bento to easily create my customized VBox images.
As much more interested in x86_64 virtual box images, I tried that first but the default boot_command is not understand by alpine boot process also I try to figure out how to start an unattended config and would like to suggest this first update:

diff --git a/os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl b/os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl
index 18a3b15..39ae540 100644
--- a/os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl
+++ b/os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl
@@ -6,4 +6,15 @@ iso_checksum            = "file:https://dl-cdn.alpinelinux.org/alpine/v3.21/rele
 parallels_guest_os_type = "otherlinux"
 vbox_guest_os_type      = "ArchLinux_64"
 vmware_guest_os_type    = "otherlinux-64"
-boot_command            = ["<wait><up>e<wait><down><down><end> inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/41/Server/x86_64/os/ <F10><wait>"]
+boot_command            = ["<wait10>root<enter>ifconfig eth0 up<enter>",
+"setup-interfaces<enter><enter><enter><enter>",
+"setup-keymap<enter>us<enter>us<enter>",
+"setup-hostname<enter>alpinet1<enter>",
+"setup-timezone<enter>GMT<enter>",
+"setup-proxy<enter>none<enter>",
+"setup-ntp<enter>chrony<enter>",
+"setup-apkrepos<enter>c<enter><enter>",
+"setup-user -u vagrant<enter>",
+"setup-sshd<enter>openssh<enter>",
+"setup-disk<enter>sda<enter>lvm<enter>sys<enter>y<enter>",
+"reboot<enter>"]

This already help to setup vm but packer is not yet already able to connect to this vm via ssh :(
Any idea?

Thanks a lot for your nice job,
Rudy

@SamuelMarks
Copy link
Author

@rubisher Yeah I tried this one also https://wiki.alpinelinux.org/wiki/Packer_installation

The closest I've gotten to a working build is https://github.com/SamuelMarks/alpine-packer/tree/3.21

But would prefer the bento build working as it supports more VM systems (hypervisors, vendors) and architectures. The alpine IRC channel is the closest we'll get to official support on this FYI

In the meantime happy to collab

@Stromweld
Copy link
Collaborator

nice work so far guys thanks for the addition. let me know if you need any extra help. I've been pretty busy with work lately so I've been a bit spotty on further updates in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alpine Linux support
3 participants