Need help troubleshooting a docker assignment

Hi all,
I am completely new to docker and trying to learn. I am taking a class for Docker and was given an assignment, and I am honestly lost after already doing some of the basic troubleshooting and editing configuration files.

I was given a puzzle assignment with many different tasks. The last task I have is some ‘senddata_intel’ 32-bit ELF executable binary file I am using to run from Docker on RHEL 9.

Here is the Task/Assignment for this file…
My code senddata always fails :frowning: Fix it for me!
Use suitable binary architecture for you.
Everything you need is inside the container.

When I run it, I get this:
[root@localhost puzzle_room]# ./senddata_intel
loading my awesome service
*going to upload a file to http://127.0.0.1:8080/upload *
Error: Post “http://127.0.0.1/upload”: dial tcp 127.0.0.1:80: connect: connection refused

Now, I know there must be something wrong with the nginx service configuration and I thought I fixed that by editing this file, nginx.conf, and changing 80 to 8080. But after making the changes, I am still getting the error above.

/var/lib/docker/overlay2/72ec47590642ca140199544db98f82b14746fa2b24646cf3b0fc415335b098f7/diff/etc/nginx/nginx.conf

I am not sure of what else to check or if I am editing the wrong config file. Any help at all would be greatly appreciated!

If you are taking a Docker course, they should have told you to never edit files in /var/lib/docker directly :wink:

Is your web server on host or in a different container?

Good to know. What is recommended when editing files?

The web server, ngnix, resides in the container from what I understand.

You better figure that out, we don’t know and can’t help you on that :slightly_smiling_face:

But it seems a bit strange for a Docker course. Containers are for isolation, separation of concerns. Usually you would run a process per container, so one container for the program and another one for nginx.

And localhost (127.0.0.1) of one container is not localhost of the node and not localhost of another container. So you would need to connect via container name or service name, if it’s in different containers.

Also note the discrepancy of the port number. Why would the script say port 8080 and the use port 80?

Mostly nothing. You either rebuild the docker image or mount config and data. But it all depends on the course what you learned. I don’t think that using Docker on RHEL and dealing with different architectures is the best way to start learning about Docker when they don’t even teach you the basics about how you should or should not change a file in a container.

Thank you @rimelek and @bluepuma77 for the help. I was able to figure it out. The error message about the ports was meant to throw me off the trail. I found that the issue was the nginx.conf file. The sendata_intel app has a minimum needed for upload. It was set too low in the nginx.conf file and all I had to do was increase the size of the upload argument. Took me a couple of days to figure it out but ultimately the error logs pointed to the issue.