-
Describe the bug
Actual behaviorHello i have this code for attach a specific container with GOT and retrive log stream (according to docker documentation) Code to reproduceconst got = require("got");
(async () => {
const stream = await got('unix:/var/run/docker.sock:/containers/efbb049e620f/attach', {
method: 'post',
searchParam: {
stream: true,
stdin: true,
stdout: true,
stderr: true,
},
isStream: true
});
stream.on('data', console.log);
})(); but when i run this code i dont see any log in the console, how i can resolve this? Checklist
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
It doesn't show anything because you didn't send your data. https://nodejs.org/api/stream.html#stream_writable_end_chunk_encoding_callback |
Beta Was this translation helpful? Give feedback.
-
Hi @szmarczak, if i use dockerode attach command and I run it with the same params I see docker container logs into the console. I test my got code with httpbin socket endpoint and it works. apparently, it doesn't work with unix sockets |
Beta Was this translation helpful? Give feedback.
-
I think you're doing something wrong. We have tests for unix sockets and they pass. |
Beta Was this translation helpful? Give feedback.
-
resolved! I put an empty json object to the request.
|
Beta Was this translation helpful? Give feedback.
It doesn't show anything because you didn't send your data.
https://nodejs.org/api/stream.html#stream_writable_end_chunk_encoding_callback