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

Remove the embedded default user in alpine cloud #2364

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented May 25, 2024

There should not be a non-system user in the image.

Let cloud-init handle the users and groups instead.

Closes #2362

Fixes the boot on Linux, and then you can add nerdctl.


sudo apk add nerdctl containerd buildctl buildkit

lima-alpine-image:/home/anders$ sudo nerdctl version
Client:
 Version:	1.7.6
 OS/Arch:	linux/amd64
 Git commit:	<unknown>
 buildctl:
  Version:	0.12.5
  GitCommit:	alpine

Server:
 containerd:
  Version:	v1.7.10
  GitCommit:	4e1fe7492b9df85914c389d1f15a3ceedbb280ac
 runc:
  Version:	1.1.12
  GitCommit:	51d5e94601ceffbbd85688df1c928ecccbfa4685
lima-alpine-image:/home/anders$ df -h /dev/vda1 /dev/vda2
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       486K  282K  204K  59% /boot/efi
/dev/vda2        94G  453M   90G   1% /

@AkihiroSuda AkihiroSuda added this to the v0.23.0 (tentative) milestone May 27, 2024
@AkihiroSuda AkihiroSuda added the guest/alpine Guest: Alpine label May 27, 2024
@AkihiroSuda
Copy link
Member

Can we test this in CI?

@afbjorklund
Copy link
Member Author

Can we test this in CI?

Testing on Linux should be enough, I think that Mac "got away" with it because it uses UID 500 ?

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with deleting the alpine user; it only exists so you can test the image without setting up a cloud-init profile.

But I think we should make an exception if the local user is also called alpine. Otherwise we would have to use the lima user name inside the VM.

Note that I haven't tested if using alpine as a host username would work otherwise; maybe it would still be broken for other reasons.

@afbjorklund
Copy link
Member Author

afbjorklund commented May 27, 2024

I'm fine with deleting the alpine user; it only exists so you can test the image without setting up a cloud-init profile.

I think that cloud-init should handle this anyway, by using the "default_user" and the distro default /etc/could config?

So it should probably be made conditional, and not be called for "cloudinit" variant

There should not be a non-system user in the image.

Let cloud-init handle the users and groups instead.

Signed-off-by: Anders F Björklund <[email protected]>
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jandubois jandubois merged commit 43d66a5 into lima-vm:master Jul 16, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guest/alpine Guest: Alpine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User creation errors, with the new alpine-image template
3 participants