You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running rootful docker on a ubuntu 24.04 VM. Yesterday I stopped VM instance, reboot my MacBook M2, started the VM instance again, and found that all my docker images and volumes are lost.
I ran ls and it shows that the whole /var/lib/docker directory somehow gets recreated.
Here is my lima.yaml for the VM instance:
# A template to use Docker (rootful) instead of containerd & nerdctl# $ limactl start ./docker-rootful.yaml# $ limactl shell docker-roootful docker run -it -v $HOME:$HOME --rm alpine# To run `docker` on the host (assumes docker-cli is installed):# $ export DOCKER_HOST=$(limactl list docker-rootful --format 'unix://{{.Dir}}/sock/docker.sock')# $ docker ...# This template requires Lima v0.20.0 or laterimages:
# 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-20241004/ubuntu-24.04-server-cloudimg-amd64.img"arch: "x86_64"digest: "sha256:fad101d50b06b26590cf30542349f9e9d3041ad7929e3bc3531c81ec27f2c788"
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20241004/ubuntu-24.04-server-cloudimg-arm64.img"arch: "aarch64"digest: "sha256:e380b683b0c497d2a87af8a5dbe94c42eb54548fa976167f307ed8cf3944ec57"# 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"mounts:
- location: "~"
- location: "/tmp/lima"writable: true# containerd is managed by Docker, not by Lima, so the values are set to false here.containerd:
system: falseuser: falseprovision:
- mode: system# This script defines the host.docker.internal hostname when hostResolver is disabled.# It is also needed for lima 0.8.2 and earlier, which does not support hostResolver.hosts.# Names defined in /etc/hosts inside the VM are not resolved inside containers when# using the hostResolver; use hostResolver.hosts instead (requires lima 0.8.3 or later).script: | #!/bin/sh sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts
- mode: systemscript: | #!/bin/bash set -eux -o pipefail command -v docker >/dev/null 2>&1 && exit 0 if [ ! -e /etc/systemd/system/docker.socket.d/override.conf ]; then mkdir -p /etc/systemd/system/docker.socket.d # Alternatively we could just add the user to the "docker" group, but that requires restarting the user session cat <<-EOF >/etc/systemd/system/docker.socket.d/override.conf [Socket] SocketUser={{.User}} EOF fi export DEBIAN_FRONTEND=noninteractive #curl -fsSL https://get.docker.com | sh curl -fsSL https://get.docker.com -o get-docker.sh sudo DOWNLOAD_URL=https://mirrors.ustc.edu.cn/docker-ce sh get-docker.shprobes:
- script: | #!/bin/bash set -eux -o pipefail if ! timeout 30s bash -c "until command -v docker >/dev/null 2>&1; do sleep 3; done"; then echo >&2 "docker is not installed yet" exit 1 fi if ! timeout 30s bash -c "until pgrep dockerd; do sleep 3; done"; then echo >&2 "dockerd is not running" exit 1 fihint: See "/var/log/cloud-init-output.log" in the guestnetworks:
- vzNAT: truehostResolver:
# hostResolver.hosts requires lima 0.8.3 or later. Names defined here will also# resolve inside containers, and not just inside the VM itself.hosts:
host.docker.internal: host.lima.internalportForwards:
- guestSocket: "/var/run/docker.sock"hostSocket: "{{.Dir}}/sock/docker.sock"message: | To run `docker` on the host (assumes docker-cli is installed), run the following commands: ------ docker context create lima-{{.Name}} --docker "host=unix://{{.Dir}}/sock/docker.sock" docker context use lima-{{.Name}} docker run hello-world ------
Does lima has some sort of recreating mechanism for /var/lib/docker?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
lima version: 1.0.1
I'm running rootful docker on a ubuntu 24.04 VM. Yesterday I stopped VM instance, reboot my MacBook M2, started the VM instance again, and found that all my docker images and volumes are lost.
I ran
ls
and it shows that the whole/var/lib/docker
directory somehow gets recreated.Here is my
lima.yaml
for the VM instance:Does lima has some sort of recreating mechanism for
/var/lib/docker
?Beta Was this translation helpful? Give feedback.
All reactions