Comments (9)
Thanks!
It's normal in ansi terminal output :)
Had to solve that same problem in nodechecker.com stdout and stderr outputs.
Check this out:
https://github.com/apocas/nodechecker.com/blob/master/public/js/views/module.js#L15
https://github.com/drudru/ansi_up (great lib to convert ansi to formatted html, if you need it)
EDIT:
Just read details...
Humm that seems an encoding issue somewhere. Not the usual ansi formatting issue.
Can't remember if I ever encountered something like that.
from dockerode.
Thank you -- I ended up doing a regex whitelist against the output -- which still sucks but at least it's readable and doesn't destroy the terminal:
var patt = /([0-9a-zA-Z'"#,\-/_ .@]+)/;
stream.on('data', function (chunk) {
var str = chunk.toString('utf-8');
var match = str.match(patt);
if (match) {
console.log(match[0])
}
});
from dockerode.
Will close this for now.
If we find it's source and if it's related with dockerode then it will be tackled :)
from dockerode.
@apocas please see moby/moby#7375 (comment) should this be handled by dockerode, or my downstream application ?
from dockerode.
Humm. Dockerode already tackles this and "demuxes" the streams for you if you want.
Now i think you probably are just not attaching correctly or forgot to demux the stream.
Check this attach scenario in here: https://github.com/apocas/nodechecker-tester/blob/master/lib/container.js#L120
Are you attaching and demuxing like this?
from dockerode.
Ah so I need to use that -- sweet deal thanks @apocas
from dockerode.
No problem. Sorry for not figuring out what was happening faster, I thought you were already demuxing :)
from dockerode.
All good man thanks for building this BADASS library :)
from dockerode.
Is there any suggested solution for this? The solution by @kfatehi works but it still shows some weird chars
from dockerode.
Related Issues (20)
- Improve JSDoc typings for optional parameters
- Getting one garbage character from container.exec() HOT 4
- Mounting container on directory HOT 1
- Sending stdin on container HOT 3
- dockerode.getConfig().remove() HOT 1
- containerAttach is sending parameter as POST JSON payload while it shouldn't HOT 1
- Pushing an image to private registry with auth not working HOT 1
- Error while installing with pnpm
- ContainerStartOptions does not contain abortSignal property HOT 1
- Missing Changelog HOT 5
- Specifying socketPath but Dockerode is using HTTP. (bun.js) HOT 12
- Image name when we use buildImage doesn't work HOT 1
- Changelog HOT 4
- Undocumented breaking change: container.logs now produces a string HOT 8
- Error building image
- Error to get logs on some containers HOT 1
- Passing filter options to pruneImages HOT 1
- Module parse failed: Unexpected character '�' (1:0) HOT 1
- Restore exec stream
- Source directory and Dockerfile in different locations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerode.