Skip to content

Persist Logs on container restart #3661

@coderbirju

Description

@coderbirju

What is the problem you're trying to solve

In nerdctl, logs are not persisted when containers are restarted or recreated. This behavior is observed in the following scenarios:

  • Using nerdctl run followed by nerdctl start -a
  • Using nerdctl restart
  • Using nerdctl create followed by nerdctl start and nerdctl restart
    In all these cases, only the most recent logs are available after a container restart or recreation.

Describe the solution you'd like

nerdctl should log persist logs similar to Docker and Podman.

Specifically:
Logs should be preserved across container restarts.

When using nerdctl start -a on a previously run container, both old and new logs should be accessible.
The nerdctl restart command should not replace previous logs but append new ones.
Containers created with nerdctl create and then started should maintain their logs across multiple starts.

Additional context

No response

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