mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Merge pull request #26534 from allencloud/better-checkpoint
change code and fix docs about checkpoint Upstream-commit: 047400c64c9a19fe9c20176dc9ca5d86301a91ae Component: engine
This commit is contained in:
@@ -28,7 +28,7 @@ func (s *checkpointRouter) postContainerCheckpoint(ctx context.Context, w http.R
|
||||
return err
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -42,13 +42,13 @@ func (daemon *Daemon) CheckpointDelete(name string, checkpoint string) error {
|
||||
return os.RemoveAll(filepath.Join(checkpointDir, checkpoint))
|
||||
}
|
||||
|
||||
// CheckpointList deletes the specified checkpoint
|
||||
// CheckpointList lists all checkpoints of the specified container
|
||||
func (daemon *Daemon) CheckpointList(name string) ([]types.Checkpoint, error) {
|
||||
response := []types.Checkpoint{}
|
||||
var out []types.Checkpoint
|
||||
|
||||
container, err := daemon.GetContainer(name)
|
||||
if err != nil {
|
||||
return response, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
checkpointDir := container.CheckpointDir()
|
||||
@@ -61,7 +61,6 @@ func (daemon *Daemon) CheckpointList(name string) ([]types.Checkpoint, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out []types.Checkpoint
|
||||
for _, d := range dirs {
|
||||
if !d.IsDir() {
|
||||
continue
|
||||
|
||||
@@ -35,7 +35,7 @@ not optimized for the task).
|
||||
|
||||
## Using Checkpoint & Restore
|
||||
|
||||
A new top level commands `docker checkpoint` is introduced, with three subcommands:
|
||||
A new top level command `docker checkpoint` is introduced, with three subcommands:
|
||||
- `create` (creates a new checkpoint)
|
||||
- `ls` (lists existing checkpoints)
|
||||
- `rm` (deletes an existing checkpoint)
|
||||
@@ -44,9 +44,9 @@ Additionally, a `--checkpoint` flag is added to the container start command.
|
||||
|
||||
The options for checkpoint create:
|
||||
|
||||
Usage: docker checkpoint [OPTIONS] CONTAINER CHECKPOINT_ID
|
||||
Usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT
|
||||
|
||||
Checkpoint the specified container
|
||||
Create a checkpoint from a running container
|
||||
|
||||
--leave-running=false leave the container running after checkpoint
|
||||
|
||||
|
||||
Reference in New Issue
Block a user