-
Notifications
You must be signed in to change notification settings - Fork 600
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
PoC: Allow loading images by name from imagestore #2404
base: master
Are you sure you want to change the base?
Conversation
It would be possible to have both of them in the same yaml file, as separate documents. Like for "exporting"... Then you would fill in the value of the current image name, with the location and digests of the current images. image: ubuntu:24.04
mounts:
- location: "~"
- location: "/tmp/lima"
writable: true
---
name: "ubuntu:24.04"
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" Here the "image" and "name" are optional, since it is self-contained and only needs to be merged. |
d8df170
to
1dca87f
Compare
examples/default.yaml
Outdated
@@ -19,6 +19,9 @@ os: null | |||
# 🟢 Builtin default: "default" (corresponds to the host architecture) | |||
arch: null | |||
|
|||
# Name of image to use. | |||
image: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative design to this PR would be to support extending YAML
e.g.
extend: "template://ubuntu"
I think there was a GitHub issue, but I can't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another alternative is copy/paste, but they are both slightly more "technical"
You might also inherit more settings than just images, by including/extending?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also inherit more settings than just images, by including/extending?
Yes
The goal was to 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 FROM ubuntu:24.04 Should probably open a new ticket for discussion about that, old one was just "reuse" EDIT: #2418 |
f8fdcf7
to
7019976
Compare
f2ef391
to
491da12
Compare
Now allows using "default" instead of the default name (currently Maybe something similar should be added for mounts, to get the default mounts? # This template requires Lima v0.7.0 or later.
images:
- default
mounts:
- default func defaultMounts() []Mount {
return []Mount{
{
Location: "~",
Writable: ptr.Of(false),
},
{
Location: "/tmp/lima",
Writable: ptr.Of(true),
},
}
} https://github.com/lima-vm/lima/blob/master/examples/ubuntu.yaml |
32159b6
to
f517ff6
Compare
Signed-off-by: Anders F Björklund <[email protected]>
Signed-off-by: Anders F Björklund <[email protected]>
f517ff6
to
3fda61d
Compare
This allows you to have a template like:
Loading from another document like:
This makes it more similar to an OCI registry (or Vagrant), and allows for even using one (or IPFS) in the future.
Perhaps "images" isn't the best name, since unlike a vagrant box there are no images contained in the directory.
The current implementation is just using the yaml filename, rather than the "name" field in the document itself.Closes #2418
Closes #2422