Merge pull request #2066 from jsternberg/early-flock-release

commands: release the file lock before attempting to boot during create
This commit is contained in:
CrazyMax 2023-09-30 12:40:02 +02:00 committed by GitHub
commit a012e0043b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,7 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
if err != nil {
return err
}
// Ensure the file lock gets released no matter what happens.
defer release()
name := in.name
@ -300,6 +301,10 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
}
}
// The store is no longer used from this point.
// Release it so we aren't holding the file lock during the boot.
release()
if in.bootstrap {
if _, err = b.Boot(ctx); err != nil {
return err