Error running ngnix on docker

Hi, I’m a newbie on docker and trying to run ngnix. Below is the error i keep receiving. Please advise…

root@ubuntu-1:~# docker run --restart=always nginx
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/06/14 22:33:06 [notice] 1#1: using the “epoll” event method
2022/06/14 22:33:06 [notice] 1#1: nginx/1.21.6
2022/06/14 22:33:06 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2022/06/14 22:33:06 [notice] 1#1: OS: Linux 5.4.0-99-generic
2022/06/14 22:33:06 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/06/14 22:33:06 [notice] 1#1: start worker processes
2022/06/14 22:33:06 [notice] 1#1: start worker process 30

I don’t see any error message there. If you want to run nginx in the background, use -d after the run subcommand.

It never goes beyond the start worker process 30

Like @rimelek wrote, there is no error in the logs.

What you see is the output of the entrypoint script and the last 7 lines are application logs from nginx itself.

If you want further logs, you will need to access the nginx container. In order to do so, you need to map one or more ports when creating the container, something like this should do: docker run -p 80:80 --restart=always nginx

May I suggest this free self-paced docker training: Introduction to Containers. It will give you a solid foundation about docker concepts and how things are done in docker.

Thanks. I’ll check the course out.