You are not logged in.

#1 2018-09-07 17:59:42

ArchBoxHero
Member
From: New Jersey
Registered: 2017-09-25
Posts: 10

(SOLVED)?Docker containers showing old container(shutdown) in browser

Hey Birds, I have been on slack channels, stack forums, through the arch forums, and in Udemy forums. So this is my final stop. Here is the problem:

I have docker running. I have a simple node app running with just a hello world server. I build the container and then run the container, no problems there. I then try to access the app in the browser. I get

connection reset by peer

. So i decided to reboot and build an older node app I had in the past. I build it, run it, and then access it in the browser. Here is the Dockerfile from that app(we'll call it appA):

FROM node:6-alpine

EXPOSE 3000

RUN apk add --update tini

RUN mkdir -p /usr/src/app

WORKDIR /usr/src/app
COPY package.json package.json

RUN npm install && npm cache clean --force

COPY . .

CMD ["/sbin/tini", "--", "node", "./bin/www"]

And here is the Dockerfile for the one I am having problems with(we'll call it appB):

FROM node:6-alpine

EXPOSE 3000

# Get the files needed i.e. -package.json
COPY ./ ./

# Install some dependencies
RUN	npm install && npm cache clean --force
# Default command
CMD ["npm", "start"]

So you can see this one having issues is much simpler then the container that works. 

Here is where it gets weird. I shut down and remove appA container. And then remove and rebuild appB.  Then I open the browser and go to the port and I am getting

connection reset

BUT!!!
I then hit refresh and there it is....appA. Now I remind you that appA is shutdown and removed. So how is it that It shows up in my browser still and why can't I get access to the appB???

A few more things:

✘ arcarius@archBoxHero ~ curl -v 127.0.0.1:8081 

 Rebuilt URL to: 127.0.0.1:8081/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:8081
> User-Agent: curl/7.60.0
> Accept: */*
> 
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

And then after grabbing the IP for the container:

 ✘ arcarius@archBoxHero ~  curl -v 172.17.0.3:3000      <-------I have port 3000 exposed for [em]appB[/em]      
* Rebuilt URL to: 172.17.0.3/
*   Trying 172.17.0.3...
* TCP_NODELAY set
* connect to 172.17.0.3 port 80 failed: Connection refused
* Failed to connect to 172.17.0.3 port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 172.17.0.3 port 80: Connection refused

Any information I can provide. I have to step out for a 20-30 minutes and get away from this before I lose it. Either way, be back soon and really appreciate any help.


Other info:

docker version: 

Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa8257ec
 Built:             Sun Aug 19 09:47:50 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.0-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       0ffa8257ec
  Built:            Sun Aug 19 09:47:31 2018
  OS/Arch:          linux/amd64
  Experimental:     false

docker ps:

 arcarius@archBoxHero  ~/DevWork/UdemyCourse/Docker-StephenGrider  docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                    NAMES
4357a7d0bb4f        joeybronzoni/nodewebapp:latest   "npm start"              41 minutes ago      Up 41 minutes       0.0.0.0:8081->3000/tcp   alpinenode
70c80334182f        joeybronzoni/masternode:latest   "/sbin/tini -- node …"   About an hour ago   Up About an hour    0.0.0.0:8080->3000/tcp   masternode
arcarius@archBoxHero  ~/DevWork/   netstat --listen | grep 8081
 ✘ arcarius@archBoxHero  ~/DevWork/  
 ✘ arcarius@archBoxHero  ~/DevWork/ netstat -r                  
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.8.8.1        128.0.0.0       UG        0 0          0 tun0
default         _gateway        0.0.0.0         UG        0 0          0 wlp3s0
10.8.8.0        0.0.0.0         255.255.255.0   U         0 0          0 tun0
128.0.0.0       10.8.8.1        128.0.0.0       UG        0 0          0 tun0
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-99063485a103
172.19.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-ff11dc55dd27
172.20.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-ad093d25aa9a
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlp3s0
dendritics.com  _gateway        255.255.255.255 UGH       0 0          0 wlp3s0
 arcarius@archBoxHero  ~/DevWork/  
docker container run -it --name alpinenode -p 8081:3000 joeybronzoni/nodewebapp:latest 
docker container run -it --name masternode -p 8080:3000 joeybronzoni/masternode:latest
 arcarius@archBoxHero  ~/DevWork/  docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
0b06d6556e1b        bridge               bridge              local
ad093d25aa9a        bridge_new       bridge              local
7ed21df1175b        host                   host                 local
99063485a103        my_app_net      bridge             local
cca100fb1225        none                   null                 local

Last edited by ArchBoxHero (2018-09-09 14:55:01)


"Ms. Pacman" should be the cleanup manager....

Offline

#2 2018-09-09 15:01:33

ArchBoxHero
Member
From: New Jersey
Registered: 2017-09-25
Posts: 10

Re: (SOLVED)?Docker containers showing old container(shutdown) in browser

I suppose it was the VPN I had running and I was using a

alias docker="sudo docker"

instead of adding my user to the docker group that was causing the issue (but confirmation would be appreciated).  On top of that I had my httpd running. So yea, amateur hour over here.  But feel free to take a look at my post with my emacs/video/audio issue. Its been up for quite some time. That one has me scratching my dome.

Last edited by ArchBoxHero (2018-09-09 15:02:52)


"Ms. Pacman" should be the cleanup manager....

Offline

Board footer

Powered by FluxBB