Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
docker does not expose static ip for container

i am trying to bind container with nginx to ip 172.16.238.10 , but for some reason docker ignores settings in docker-compose

#my docker-compose file
version: "3.9"

services:

    nginx:
        build: nginx/
        ports: 
            - 80:80/tcp
        volumes:
            ./dokcer/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
            ./dokcer/nginx/conf/hosts:/etc/hosts
            ./docker/project:/var/www/project
        networks:
            app_net:
                ipv4_address: 172.16.238.10


    php-fpm:
        build: php-fpm/
        ports:
            - 9000:9000/tcp
        volumes:
            ./dokcer/php-fpm/conf/www.conf:/usr/local/etc/php-fpm.d/www.conf
            ./dokcer/php-fpm/conf/hosts:/etc/hosts
            ./dokcer/project:/var/www/project
        networks:
            app_net:
                ipv4_address: 172.16.238.11

networks:
    app_net:
        ipam:
            driver: default
            config:
                - subnet: "172.16.238.0/24"

after build and launch, I look at the docker_app_net network and see that the nginx container has ip 172.16.238.2 although I expected it to be 172.16.238.10.

what could be the problem? I will be grateful for every answer because I am confused :c

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!