Docker attach gives empty new line

AI-generated summary

The user bquast encountered an issue where docker attach resulted in an empty line with no command response. pfaffman suggested using docker exec -it app bash, which worked for running commands like ls. bquast confirmed this solved the problem but wanted to understand why docker attach failed. Ed_S clarified that docker exec provides a shell inside the container, which is the intended functionality. bquast later found that the issue stemmed from a web server running in the container, making docker attach ineffective. pfaffman also recommended using the data explorer plugin or administrative bulk operations for database exploration.

Hello, I have an instance of docker (the supported image).

When I try to docker attach it just shows the cursor blinking on an empty line, there is no response to commands like ls.

How about

docker exec -it app bash -c "your command here"

Yes that worked (with ls)

Great! Please mark as solved so the topic gets closed. Glad that worked!

Done!

But I’d still like to know what the problem was

and

How can I functionally attach?

Is it something like ./launcher enter app that you’re looking for? That’ll give you a shell prompt inside the container. I don’t know how to do it with docker directly, but maybe docker exec -it app bash

Indeed that is my objective, I want to sniff around the database tables.

I will try docker exec -it app bash

I thought that this was what docker attach was for, but I’m not an expert.

Looking further based on the hints fomr @pfaffman and @Ed_S, this answer from SO explained it well (accepted answer)

EDIT: the point is that a web server is running on the image, so docker attach doesn’t work, but the exec command does

Then maybe use the data explorer plugin. That’s a much better way to explore the database.

But maybe you’d be interested in Administrative Bulk Operations