-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nerdctl logs
for the containers running without -d
#1657
Comments
/assign |
Trying error log tracing in nerdctl logs -> log_viewer.InitContainerLogViewer() -> logging.LoadLogConfig() The error is failed in The logConfigFilePath is the log-config.json in current container's dataStore dir. log-config.json's directory of the container running by
log-config.json's directory of the container running by
Found the line to write log-config.json. |
Just found this recent merged PR fixed the error. The log-config.json appears in the container ran by However, there is no log in the container ran by Ran Ran |
When the container is run with |
Currently, -it uses the ioCreator to write stdOut to console.Current(). -d uses the ioCreator to write to uri.String(). |
@ningziwen Do you still plan to work on this? |
Yes but it will take some time. Feel free to take over if you have urgent need of this feature. |
@ningziwen I can work on this if it's okay. |
@danishprakash Sure go ahead. |
I spent some time looking at this and based on what @ningziwen has already mentioned, I tried to create a multiwriter and create a ioCreator out of it but it's messy and didn't work primarily because @yzxiu when you say we need to copy the logs over explicitly, shouldn't that piece go into containerd? I'm new to this project so still trying to understand the demarcations. Sorry If I missed anything. |
I think this issue can be closed then in lieu of #1946 |
No, that one is a different topic |
As per SCOPE.md which states that “Logging can be build on top of containerd because the container’s STDIO will be provided to the clients and they can persist any way they see fit. There is no io copying of container STDIO in containerd.” So this rules out modifying/creating the A proposal to solve this is for nerdctl to implement it's own I made draft PR: #2683 and ran some sanity tests
cc @fahedouch @AkihiroSuda Let me know if this approach is okay and I can work on getting my PR merged. Thanks! |
What is the problem you're trying to solve
Support
nerdctl logs
for the containers running without -dREADME.md already stated it is not supported yet. So opening a feature request instead of a bug report.
Reproducd by building source code from main branch.
Describe the solution you'd like
Add the feature to support logs command with the container running without -d.
Additional context
runfinch/finch#85
The text was updated successfully, but these errors were encountered: