Giter VIP home page Giter VIP logo

Comments (8)

devopseze avatar devopseze commented on August 24, 2024 13

I am equally having the same issue unable to curl the localhost to port 8080. The Tomcat docker container is running fine as supposed.
curl: (7) Failed connect to localhost:8080; Connection refused

from atsea-sample-shop-app.

siddjain avatar siddjain commented on August 24, 2024

It looks like the problem is that there are no ports exposed to the outside world

siddjain@goldenrwr-peer0:~$ docker ps
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS              PORTS                                            NAMES
041d4fb98ae8        dockersamples/atsea_app:latest         "java -jar /app/AtSe…"   4 days ago          Up 4 days                                                            atsea_appserver.2.idrg0djwuy5xwnmfsowgml5b0
c77354585b06        hyperledger/fabric-peer:x86_64-1.0.1   "peer node start --p…"   4 months ago        Up 3 months         0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp   kind_murdock

one can ssh into the container by running

siddjain@goldenrwr-peer0:~$ docker exec -it atsea_appserver.2.idrg0djwuy5xwnmfsowgml5b0 sh

but curl is not installed on the container and so curl http://localhost:8080 will fail

from atsea-sample-shop-app.

siddjain avatar siddjain commented on August 24, 2024

some more info

siddjain@goldenrwr-peer0:~$ docker exec -it atsea_appserver.2.idrg0djwuy5xwnmfsowgml5b0 sh
/app # ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:0A:00:06:0A  
          inet addr:10.0.6.10  Bcast:10.0.6.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:12456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16152 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1526790 (1.4 MiB)  TX bytes:1426938 (1.3 MiB)

eth1      Link encap:Ethernet  HWaddr 02:42:0A:00:09:0A  
          inet addr:10.0.9.10  Bcast:10.0.9.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth2      Link encap:Ethernet  HWaddr 02:42:0A:00:08:08  
          inet addr:10.0.8.8  Bcast:10.0.8.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1424  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth3      Link encap:Ethernet  HWaddr 02:42:AC:12:00:03  
          inet addr:172.18.0.3  Bcast:172.18.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:14348 (14.0 KiB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2286 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2286 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:150876 (147.3 KiB)  TX bytes:150876 (147.3 KiB)

from atsea-sample-shop-app.

siddjain avatar siddjain commented on August 24, 2024
siddjain@goldenrwr-peer1:~$ docker exec -it atsea_appserver.1.56eghx4ss6cbghsslap14oq58 sh
/app # ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:0A:00:06:09  
          inet addr:10.0.6.9  Bcast:10.0.6.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:12247 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15943 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1526825 (1.4 MiB)  TX bytes:1434013 (1.3 MiB)

eth1      Link encap:Ethernet  HWaddr 02:42:0A:00:09:09  
          inet addr:10.0.9.9  Bcast:10.0.9.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth2      Link encap:Ethernet  HWaddr 02:42:0A:00:08:07  
          inet addr:10.0.8.7  Bcast:10.0.8.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1424  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth3      Link encap:Ethernet  HWaddr 02:42:AC:12:00:03  
          inet addr:172.18.0.3  Bcast:172.18.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:203 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:14306 (13.9 KiB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2018 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2018 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:133188 (130.0 KiB)  TX bytes:133188 (130.0 KiB)

/app # ping 10.0.6.10
PING 10.0.6.10 (10.0.6.10): 56 data bytes
64 bytes from 10.0.6.10: seq=0 ttl=64 time=0.925 ms
64 bytes from 10.0.6.10: seq=1 ttl=64 time=0.615 ms
64 bytes from 10.0.6.10: seq=2 ttl=64 time=0.585 ms
64 bytes from 10.0.6.10: seq=3 ttl=64 time=0.691 ms
64 bytes from 10.0.6.10: seq=4 ttl=64 time=0.638 ms
64 bytes from 10.0.6.10: seq=5 ttl=64 time=0.900 ms
64 bytes from 10.0.6.10: seq=6 ttl=64 time=0.535 ms
64 bytes from 10.0.6.10: seq=7 ttl=64 time=0.915 ms
^C
--- 10.0.6.10 ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 0.535/0.725/0.925 ms

so container to container ping using overlay n/w IP address is working. can also ping using the container name:

/app # ping atsea_appserver.2.idrg0djwuy5xwnmfsowgml5b0
PING atsea_appserver.2.idrg0djwuy5xwnmfsowgml5b0 (10.0.6.10): 56 data bytes
64 bytes from 10.0.6.10: seq=0 ttl=64 time=0.654 ms
64 bytes from 10.0.6.10: seq=1 ttl=64 time=0.876 ms
64 bytes from 10.0.6.10: seq=2 ttl=64 time=1.397 ms
64 bytes from 10.0.6.10: seq=3 ttl=64 time=0.643 ms
64 bytes from 10.0.6.10: seq=4 ttl=64 time=1.469 ms
64 bytes from 10.0.6.10: seq=5 ttl=64 time=0.659 ms
64 bytes from 10.0.6.10: seq=6 ttl=64 time=0.846 ms
^C
--- atsea_appserver.2.idrg0djwuy5xwnmfsowgml5b0 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 0.643/0.934/1.469 ms

from atsea-sample-shop-app.

gachatur avatar gachatur commented on August 24, 2024

Changing suspend=y to suspend=n in following
Dockerfile-dev:ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005","-jar", "/app/AtSea-0.0.1-SNAPSHOT.jar"]
did the trick

from atsea-sample-shop-app.

halimah999 avatar halimah999 commented on August 24, 2024

i same the same problem any sloution?

from atsea-sample-shop-app.

jdpinedac avatar jdpinedac commented on August 24, 2024

We found several problems in that this docker example does not follow some good practices, such as specifying the concrete versions of the images. We will show the changes to each file below:

database/Dockerfile

Change:
FROM postgres
to
FROM postgres:12

Change the routes to copy the configuration files:

COPY pg_hba.conf /usr/share/postgresql/9.6/
COPY postgresql.conf /usr/share/postgresql/9.6/

to

COPY pg_hba.conf /usr/share/postgresql/12/
COPY postgresql.conf /usr/share/postgresql/12/

app/Dockerfile-dev

change:

ENTRYPOINT ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005","-jar","/app/AtSea-0.0.1-SNAPSHOT.jar"] 

a

ENTRYPOINT ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005","-jar","/app/AtSea-0.0.1-SNAPSHOT.jar"] 

docker-compose-dev.yml

In the services/database/environment section add the following line:

POSTGRES_PASSWORD: gordonpass

Thanks to @jvelez30

Please, check Pull request #130

from atsea-sample-shop-app.

BretFisher avatar BretFisher commented on August 24, 2024

Closing issues due to repo archiving. Feel free to fork so it can live on!

from atsea-sample-shop-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.