I can only get the logs from a running command when using the logOuput ConnectOption. Is there a way to use the .stdout() function on the container object to get the output?
When using the stdout function I only get the output once the command has finished its execution. When I use the logOutput Writeable I get all the logs, indistinguishable from each other.
Does somebody know a way to get "live" logs from a certain container?
There is a similar post here, but I don't think it is the same: https://discordapp.com/channels/707636530424053791/1153523694958809098
Code example:
await connect(
async (client) => {
// [...]
const builder = client
.container()
.from('node:18-alpine')
.withExec(['apk', 'add', '--no-cache', 'git'])
.withWorkdir('/app')
.withDirectory('/app', deps.directory(workDir))
.withExec(packageManager.build);
logsOutput?.write(await builder.stdout()); // Only gets the output after execution.
logsOutput?.end();
// [...]
},
{ LogOutput: logsOutput }, // Outputs "too much" information, I only need the "live feed" from the command of the builder container.
);