I have Docker running on an externally hosted server.
I have Docker installed as standard.
Now I have created an nginx Docker with this command: docker run -d -p 8080:80 --name webserver nginx.
root@ubuntu:~# docker version
Client: Docker Engine - Community
version: 24.0.2
API version: 1.43
Go version: go1.20.4
Git commit: cb74dfc
Built: Thu May 25 21:51:00 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.2
API version: 1.43 (minimum version 1.12)
Go version: go1.20.4
Git commit: 659604f
Built: Thu May 25 21:51:00 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0
I canāt get it to call the services as localhost. From external via public IP it does not work either. I have now installed Nginx Local directly on the server. There everything works fine. I come immediately on the starting side of Nginx.
What do you mean by standard? A shared link could help us to see if you really followed the recommended way, but my guess is that will not be the problem.
How did you tried? On which port? Sometimes people just use the wrong port or a wrong ip address.
Iāve been struggling for a week to get any containers running and accessible via the browser including the āgetting-startedā project from the Documentation.
And now I canāt even look at the logs for a supposed running container because the daemon reports āNo such containerā
Hi, i belive you should have opened your own thread for this, but āgetting-startedā in your case is the image, not the container, to find your containers type: docker ps, or docker ps -a to also see the exited ones
The āWebserver2ā has a new name = āWebserverā.
root@ubuntu:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
578d2299e204 nginx ā/docker-entrypoint.ā¦ā 26 hours ago Up 26 hours 0.0.0.0:8080->80/tcp, :::8080->80/tcp webserver
This is the same thing Iām running into using the āgetting-startedā tutorial from the Docker Documentation. I havenāt had any luck running anything at all.
@terpz I didnāt open a new thread because it was in response to your logs comment and Iām having the same issue as the op.
Now that I have corrected my typo and looked at the logs for wizardly_franklin instead of wizardly-franklin. Here is what Iām getting:
2023-06-29 08:13:20 /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
2023-06-29 08:13:20 /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
2023-06-29 08:13:20 /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
2023-06-29 08:13:20 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
2023-06-29 08:13:20 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
2023-06-29 08:13:20 /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
2023-06-29 08:13:20 /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
2023-06-29 08:13:20 /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
2023-06-29 08:13:20 /docker-entrypoint.sh: Configuration complete; ready for start up
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: using the "epoll" event method
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: nginx/1.25.1
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: OS: Linux 5.15.90.1-microsoft-standard-WSL2
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: start worker processes
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: start worker process 30
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: start worker process 31
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: start worker process 32
2023-06-29 08:13:20 2023/06/29 14:13:20 [notice] 1#1: start worker process 33
But as shown in my first screen shot I only get ERR_EMPTY_RESPONSE and canāt access the app. I donāt see any errors in the log but I guess I could be wrong.
@fatdollar You just forwarded port 3000 from the host to port 3000 in the container but the getting-started container listens on port 80 which is the default port of nginx not port 3000. @logixx forwarded the host port to the right container port. The port on the right side is always the container port.
docker run -dp 127.0.0.1:3000:80 getting-started
The above command should allow you to access the webpage from the browser on port 3000.
Please, share a link next time to the website you are using instead of a screenshot so we can find it faster. I found it and now I know I was wrong. The docker/getting-started image indeed contains an nginx that listens on port 80, but the image you created following the guide doesnāt use that. It runs nodejs and I tried it on my machine (MacBook running Docker Desktop for Mac) and port 3000 worked for me with the command that the guide mentions. I donāt have more time at the moment to investigate this issue, but is either something Windows specific or you made a mistake somewhere, but I wouldnāt be surprised by a Windows specific issue either.
Iām leaning towards it being a Windows issue to then. I just got back from a long holiday vacation so Iāll be trying to install this on my desktop server that is sort of my sand box to try things out. It is running Ubuntu so if the tutorial works Iāll just assume its windows related.
OK I have figured out the issue on my end as well. I was not in the getting-started/app folder I was in the getting-started root folder and once I changed folders all was well.