Running latest versions of docker and Kitemagic for Mac.
Have downloaded the “hello-world-nginx” image, but after starting it’s not showing the preview of the example website. How come ?
This is the installation log :
/website_files/index.html not found.
Copying default index.html…
nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (2: No such file or directory)
2020/04/17 09:26:30 [notice] 8#0: using the “epoll” event method
2020/04/17 09:26:30 [notice] 8#0: nginx/1.4.7
2020/04/17 09:26:30 [notice] 8#0: built by gcc 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r45973)
2020/04/17 09:26:30 [notice] 8#0: OS: Linux 4.19.76-linuxkit
2020/04/17 09:26:30 [notice] 8#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2020/04/17 09:26:30 [notice] 8#0: start worker processes
2020/04/17 09:26:30 [notice] 8#0: start worker process 9
Thats not how docker works. It’s kinda fully automated but for security reasons you have to specify some options yourself.
Basically you need to map a port on your host system to a port in the container (the port nginx runs on).
An example looks like this: docker run -p 8000:80 hello-world-nginx`
This will start a container bases on the image hello-world-nginx and maps your port 8000 to the containers port 80. You can choose whatever port you want instead of 8000 but you have to stick to the port 80 from nginx.
ok, thanks for putting up with my docker illiteracy… I’m really new to all this.
Ok, so pasting your command in my terminal.app returns the following :
docker run -p 8000:80 hello-world-nginx
Unable to find image ‘hello-world-nginx:latest’ locally
docker: Error response from daemon: pull access denied for hello-world-nginx, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied.
See ‘docker run --help’.
ok I put a space before the kitemagic part upfront, hope that’s what I had to do.
At least getting a different error msg now
docker run -p 8000:80 kitematic/hello-world-nginx
/website_files/index.html not found.
Copying default index.html…
nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (2: No such file or directory)
2020/04/17 11:35:21 [notice] 8#0: using the “epoll” event method
2020/04/17 11:35:21 [notice] 8#0: nginx/1.4.7
2020/04/17 11:35:21 [notice] 8#0: built by gcc 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r45973)
2020/04/17 11:35:21 [notice] 8#0: OS: Linux 4.19.76-linuxkit
2020/04/17 11:35:21 [notice] 8#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2020/04/17 11:35:21 [notice] 8#0: start worker processes
2020/04/17 11:35:21 [notice] 8#0: start worker process 9
So problematic part seems first line :
nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (2: No such file or directory)
did I have to somehow create that unexisting folder manually?
no I don’t. I thought it was sufficient to simply install the docker image, especially as it was stated as the most basic exemple on their webpage here : https://docs.docker.com/kitematic/nginx-web-server/
couldn’t/shouldn’t have gotten easier than that…
Apparently that’s not the case…
Is it an issue that I’m behind a corporate firewall and that certain ports/protocols ought to be available?
The image kitematic/hello-world-nginx got its last update 5 years ago so its most likely outdated. This might be the reason why this doesn’t work.
As long as you managed to pull the image or start a container there should be no problem. If the container on the other hand needs internet access, you have to tell him about the proxy.
If you just want a running webserver I suggest you take a look at the official nginx image. https://hub.docker.com/_/nginx
It’s well documented and explains almost everything.
Why don’t you use Docker Desktop for Mac?
The image kitematic/hello-world-nginx got its last update 5 years ago so its most likely outdated. This might be the reason why this doesn’t work.
Actually I do. I thought kitematic was just a minimal GUI frontend for the Docker desktop app, such as Dockstation, in order to make things a bit more manageable for non-*NIX geeks like me, but apparently it’s more than than.
I’ll try out your suggestions and post back… thanks
Nice.
This is not a docker problem anymore but nginx telling you that it doesn’t find a favicon. Configure nginx accordingly and the warning will go away.