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

Simplify syntax for selecting images, with locations and digests #2418

Open
afbjorklund opened this issue Jun 12, 2024 · 4 comments · May be fixed by #2404
Open

Simplify syntax for selecting images, with locations and digests #2418

afbjorklund opened this issue Jun 12, 2024 · 4 comments · May be fixed by #2404

Comments

@afbjorklund
Copy link
Contributor

afbjorklund commented Jun 12, 2024

Description

Make the usage of Lima more similar to a Vagrantfile or a Dockerfile.

Vagrant.configure("2") do |config|
  config.vm.box = "cloud-image/ubuntu-24.04"
end

https://app.vagrantup.com/cloud-image

FROM ubuntu:24.04
# or, with a fully qualified registry
FROM docker.io/library/ubuntu:24.04

https://hub.docker.com/_/ubuntu

This by separating the usage of the images with the definition of the images.

images:
- ubuntu-24.04

https://github.com/lima-vm/lima/blob/master/examples/ubuntu.yaml

ubuntu-24.04.yaml

images:
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img"
  arch: "x86_64"
  digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3"
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img"
  arch: "aarch64"
  digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22"
# Fallback to the latest release image.
# Hint: run `limactl prune` to invalidate the cache
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img"
  arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img"
  arch: "aarch64"

Closes #824

@afbjorklund afbjorklund linked a pull request Jun 12, 2024 that will close this issue
@afbjorklund afbjorklund changed the title Simplify syntax for selecting images Simplify syntax for selecting images, with locations and digests Jun 12, 2024
@afbjorklund
Copy link
Contributor Author

The new limactl validate --fill will show a preview of the actual values.

@afbjorklund
Copy link
Contributor Author

Alternatively one could use something longer like image://ubuntu-24.04

@afbjorklund
Copy link
Contributor Author

Added default for the default image, for when you don't care about the OS

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Jun 23, 2024

Also good when adding more optional fields to images - like size and cid*

* see https://docs.ipfs.tech/concepts/content-addressing/ for CID information

Example entry:

- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img"
  size: 475004928
  arch: "x86_64"
  digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3"
  cid: "bafybeig5sch22ecfox7gq724rz7uivydwvnnpuqdcnjz72iwelgtrakzui"

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 a pull request may close this issue.

1 participant