diff --git a/api/server/router/checkpoint/checkpoint_routes.go b/api/server/router/checkpoint/checkpoint_routes.go index 3b8812bfcd..ed0bfccd63 100644 --- a/api/server/router/checkpoint/checkpoint_routes.go +++ b/api/server/router/checkpoint/checkpoint_routes.go @@ -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 } diff --git a/daemon/checkpoint.go b/daemon/checkpoint.go index 0c87b373b4..010ce31e88 100644 --- a/daemon/checkpoint.go +++ b/daemon/checkpoint.go @@ -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 diff --git a/experimental/checkpoint-restore.md b/experimental/checkpoint-restore.md index 4e2bca1cd7..dc1f9cfb19 100644 --- a/experimental/checkpoint-restore.md +++ b/experimental/checkpoint-restore.md @@ -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