Docker error use of closed network connection

Problem with large docker. I try to install ABAP with docker according installing-sap-nw-abap-into-docker/. $ docker build -t nwabap:7.52 . error during connect: Post : write tcp 192.168.99.1:61360-192.168.99.101:2376: use of closed network connection Try to solve problem. # Build images and cache them to a local cache/ folder, this part takes the longest docker $ buildx

Problem with large docker. I try to install ABAP with docker according installing-sap-nw-abap-into-docker/. $ docker build -t nwabap:7.52 . error during connect: Post : write tcp 192.168.99.1:61360-192.168.99.101:2376: use of closed network connection Try to solve problem. # Build images and cache them to a local cache/ folder, this part takes the longest docker $ buildx

Problem with large docker. I try to install ABAP with docker according installing-sap-nw-abap-into-docker/.

$ docker build -t nwabap:7.52 .
error during connect: Post : write tcp 192.168.99.1:61360-192.168.99.101:2376: use of closed network connection

Try to solve problem.

# Build images and cache them to a local cache/ folder, this part takes the longest docker 
$ buildx build --cache-to=type=local,dest=cache,mode=max --platform linux/amd64,linux/arm64 --tag myimagename:latest . 
# Login docker 
$ login -u username -p password 
# Build again, but use cache from local source docker 
$ buildx build --push --cache-from=type=local,src=cache --platform linux/amd64,linux/arm64 --tag myimagename:latest

If you run a server on your machine listening on 127.0.0.1, the “loopback” or “localhost” address:

$ python3 -m http.server --bind 127.0.0.1 
Serving HTTP on 127.0.0.1 port 8000 (http://127.0.0.1:8000/) ...

You can then load it in your browser at http://127.0.0.1:8000.

But if you kill that and run it in a container:

$ docker run -p 8000:8000 -it --entrypoint=bash python:3.7-slim 
(docker) # python3 -m http.server --bind 127.0.0.1

If you then try to connect with your browser to

http://127.0.0.1:8000

you’ll get connection refused or connection reset.

For example, you can do:

$ docker run -p 8000:8000 -it python:3.7-slim python3 -m http.server --bind 0.0.0.0

Note: --bind 0.0.0.0 is specifically an option for http.server; it’s not a Docker option. Other servers will have other ways of specifying this. For example, for a Flask application packaged with a Dockerfile, you can do:

FROM python:3.7-slim-stretch
RUN pip install flask
COPY . .
ENV FLASK_APP=exampleapp:app
CMD ["flask", "run", "--host", "0.0.0.0"]

Related links:
https://pythonspeed.com/articles/docker-connection-refused/

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments