Coder Social home page Coder Social logo

Comments (8)

adnsimona avatar adnsimona commented on September 3, 2024

Windows 10 + Docker Desktop 4.21.1 (114176):

  • building locally:
  • running with custom ports using docker command:
    It works correctly.

from docker-nginx-unprivileged.

adnsimona avatar adnsimona commented on September 3, 2024

Additional info:
We had issue with "schema 2" when trying to build our new nginx based docker image on RHEL7 1.13.1, so we updated the builder machine to the one above.

from docker-nginx-unprivileged.

adnsimona avatar adnsimona commented on September 3, 2024

Maybe a clarification:
We used multiple nginxinc/nginx-unprivileged images in "network mode: host" together.
It didn't try to open any other port than specified in the nginx_template.conf's listen,
but now it wants to open the 8080 port on the host for every nginx image based container with the same setup, therefore it lets only one run, and the rest are denied. What could have changed that causing this?

from docker-nginx-unprivileged.

adnsimona avatar adnsimona commented on September 3, 2024

Considering the answer of meyay here: https://forums.docker.com/t/how-do-i-unexpose-ports/67863
in host mode the EXPOSE directive in the Dockerfile opens the port. And there is no way to remove/overwrite this directive by a new Dockerfile layer.

from docker-nginx-unprivileged.

adnsimona avatar adnsimona commented on September 3, 2024

I tried with truncating the default.conf in our dockerfile. It gave me the result on the rhel7 using 1.13.1 docker:

/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: Ignoring /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, not executable
/docker-entrypoint.sh: Ignoring /docker-entrypoint.d/15-local-resolvers.envsh, not executable
/docker-entrypoint.sh: Ignoring /docker-entrypoint.d/20-envsubst-on-templates.sh, not executable
/docker-entrypoint.sh: Ignoring /docker-entrypoint.d/30-tune-worker-processes.sh, not executable
/docker-entrypoint.sh: Configuration complete; ready for start up

But on Windows with Docker Desktop 4.24.2 it gave me a working result:

2023-10-20T08:47:03.596197000Z /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
2023-10-20T08:47:03.597089200Z /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
2023-10-20T08:47:03.598042800Z /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
2023-10-20T08:47:03.603580500Z 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
2023-10-20T08:47:03.616023200Z 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
2023-10-20T08:47:03.616382100Z /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
2023-10-20T08:47:03.616828200Z /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
2023-10-20T08:47:03.626551600Z 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/nginx.conf.template to /etc/nginx/nginx.conf
2023-10-20T08:47:03.630479800Z /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
2023-10-20T08:47:03.632278500Z /docker-entrypoint.sh: Configuration complete; ready for start up

So it didn't processed the template on the rhel7 machine, therefore it is not working correctly: /etc/nginx/nginx.conf stays the default one.

from docker-nginx-unprivileged.

adnsimona avatar adnsimona commented on September 3, 2024

stepping into the container, all look executable for all users:

-rwxr-xr-x 1 root root 2.1K Oct 16 00:06 10-listen-on-ipv6-by-default.sh
-rwxr-xr-x 1 root root  276 Oct 16 00:06 15-local-resolvers.envsh
-rwxr-xr-x 1 root root 3.0K Oct 16 00:06 20-envsubst-on-templates.sh
-rwxr-xr-x 1 root root 4.6K Oct 16 00:06 30-tune-worker-processes.sh

from docker-nginx-unprivileged.

thresheek avatar thresheek commented on September 3, 2024

See nginxinc/docker-nginx#319 for the discussion and rationale.
Also, see moby/moby#3465 for a relevant moby discussion.

from docker-nginx-unprivileged.

alessfg avatar alessfg commented on September 3, 2024

Closing this given that per the above issue threads, this is a "feature" of Docker.

You should be able to side step this issue by extending this image and doing something similar to what this comment details moby/moby#3465 (comment)

from docker-nginx-unprivileged.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.