Skip to content

ami-configure.sh: mv /var/lib/docker/* silently drops dotfiles #657

@kojiromike

Description

@kojiromike

packages/standard/ami/ami-configure.sh:26:

service docker stop
mv /var/lib/docker/* /mnt/docker
rm -rf /var/lib/docker

Same dotglob class of bug as #648 (fsupgrade-1) and #646 (smarty cache clear). * skips dotfiles, so any /var/lib/docker/.foo is silently abandoned, then destroyed by rm -rf on the next line.

For Docker's data dir, this matters: Docker writes .tmp-* sentinel files and containerd keeps hidden state. Losing them on the AMI-config-time volume migration can leave orphaned layers or broken overlays.

Suggested fix (same pattern as #648):

find /var/lib/docker/. ! -name . -prune -exec mv -f {} /mnt/docker/ +
rmdir /var/lib/docker

Flagged on PR #653 (review thread).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions