Score:1

How do I open ports on a docker image?

my flag

I am using a docker file as shown here, in my project :

https://github.com/jamiepratt/embedded-repl/blob/master/docker-compose.yml

I start the container with:

docker-compose up app

But cannot connect to the socket. Can't see what I am doing wrong.

The ports are not accessible either on my local system or when I put the docker container on a server.

After docker-compose up app I see the following:

 docker container ls
 CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS          PORTS                                                                                NAMES
 886341940c74   embedded-repl_app                "entrypoint java -ja…"   30 minutes ago   Up 30 minutes   0.0.0.0:2001->54654/tcp, :::2001->54654/tcp                                          embedded-repl_app_1

But then when I try to telnet:

telnet localhost 2001
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
Score:1
bw flag
dgj

I might be mistaken, but this looks like an issue with the application itself closing connections.

Connected to localhost.
Escape character is '^]'.

These lines above show that telnet is connecting through to docker, however the application is then closing the connection.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.