-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Alpine Linux support #1608
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
base: main
Are you sure you want to change the base?
Alpine Linux support #1608
Conversation
…ferent virtual machines based on official alpine
|
Hello Samuel,
This already help to setup vm but packer is not yet already able to connect to this vm via ssh :( Thanks a lot for your nice job, |
@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 |
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. |
Ah, I see better: if I find well your arch boot_command, I was missing the answers file :) (Not easy to understand its contain :)
Same to me but quite sure the 2 proj used the same packer based also I really think it would possible to do some reverse engineering but I don't yet reach the Corey skill also I would need some more investigation,...
Thanks again |
https://git.alpinelinux.org/alpine-conf/tree/setup-user.in may be the place where I would learn how to create a vagrant user with its 'Insecure Keypair' https://github.com/hashicorp/vagrant/tree/master/keys, though???
|
Well imho some progress: from a simple VBox, I start it with the alpinelinux install dvd.
saved in 'packer_templates/http/alpine/answers' to use an './os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl':
for 'packer build -on-error=ask -only=virtualbox-iso.vm -var-file=./os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl ./packer_templates'. Everything seems to be completed with success, after the final reboot, I can login as root with 'ssh -p xxxx root@localhost' (i.e. root passwd is correctly set) and as vagrant with his 'Insecure Keypair' (i.e /home/vagrant/.ssh/authorized_keys is also correctly setup), though. BUT still stuck after the reboot ...
@Stromweld, any idea of what can I do to continue this matter ?
:() |
You couldn't imagine how much I feeling stupid:
And unfortunately , I didn't find a clean way to setup the vagrant user password so I try this new os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl:
(@SamuelMarks your other work https://github.com/SamuelMarks/alpine-packer/blob/3.21/virtualbox-iso.pkr.hcl choose to setup root as ssh user:
I don't yet find how is it possible to do in BENTO?) That said, as alpine deprecated sudo in favour of doas in Alpine Linux since v3.15.0
I need to find out how BENTO could use doas in place of sudo ;) Take care ;) |
Hello,
Unfortunately, that failed because
But I discover that the installation DVD comes with 'chroot' also it is possible to :
That works also may be can we simply revert ./packer_templates/pkr-builder.pkr.hcl to original config? Now the last issues are the next scripts which don't look like busybox shell compatible:
@SamuelMarks: couldn't we reduce this scripts to ones you used in your 'alpine-packer' proj? Hth, |
have you tried looking at setting it up with answer file like documented here https://docs.alpinelinux.org/user-handbook/0.1a/Installing/setup_alpine.html#_full_setup_alpine. The answer file can be added as a cdrom_file then boot command is to just run setup -f pointing to answer file. The answer file can live under http files etc... similar to kickstart files. even better if can use http_file option and -f can read file from http location |
Yes, what I was finaly suggesting put an "answers" file in 'packer_templates/http/alpine/answers':
And using a boot command like:
Such that we can use the "answers" file. But the first issue is that I don't find a direct way to setup the password of "vagrant" :( The second issue is that sudo was deprecated in favour of doas in Alpine Linux since v3.15.0 , unfortunately "doas" required a tty so I tried to re-use the chroot to install sudo. (is sudo will be ignored when we specify "ssh_username = root"?) That was the most blocking points to me: the remaining ones looks to me quiet easy to fix ;) That said, if there is an actual interest to add this distro in bento, I am not a developer also not very familiar on the way to help more the initial work of Samuel. (Do I have to fork his fork to suggest him some pull request??) Thx in advance for further advises, |
if there is no clean way to set user/password I'd use root user and setup vagrant with scripts after the initial install. To make the boot command easier as well I'd use the answer file as a cdrom that can be mounted and then run setup command pointing to the answer file in it's mounted location. This simplifies things and removes dependency on network prior to install. since root is setup then that should also solve the doas configuration as it'd be done via a script after install and would then have a tty. |
As for interest, you and samualmarks are the first to ask for it, but if you build it they will come. For the repo contributions that depends on how you want to collaborate. You may be able to clone his fork and just contribute directly to his branch if he didn't lock it down. however this can lead to issue where you over write each others stuff as you are testing and iterating. Ideally you'd fork his fork and commit to your own and then submit PR back to his fork for review and merging to his branch which then would come to this PR. This can be slower though especially when making many small changes to be more collaborative. |
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
Checklist:
Gemfile.lock
has changed, I have used--conservative
to do it and included the full output in the Description above.