Skip to content
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

Each line in the logs begins with garbled characters. #86

Open
isaced opened this issue Feb 13, 2024 · 0 comments
Open

Each line in the logs begins with garbled characters. #86

isaced opened this issue Feb 13, 2024 · 0 comments

Comments

@isaced
Copy link

isaced commented Feb 13, 2024

I don't know why, but there are always a few garbled characters at the beginning of each line in the output log.

Here is my code:

// init
var docker = new Docker({ socketPath: "/var/run/docker.sock" });

// create container
const container = await docker.container.create({ Image: "hello-world" })

// start container
await container.start();

// logs
const logStream = (await container.logs({ follow: true, stdout: true, stderr: true })) as Stream;
logStream.on('data', (info) => {
    console.log(info.toString('utf-8'))
})

Output:

Hello from Docker!
KThis message shows that your installation appears to be working correctly.

;To generate this message, Docker took the following steps:
3 1. The Docker client contacted the Docker daemon.
J 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
M 3. The Docker daemon created a new container from that image which runs the
C    executable that produces the output you are currently reading.
O 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

GTo try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

BShare images, automate workflows, and more with a free Docker ID:
ttps://cloud.docker.com/

$For more examples and ideas, visit:
+ https://docs.docker.com/engine/userguide/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant