Docker Community Forums

Share and learn in the Docker community.

How to set static ip address in compose.yml


(Balamurugant) #1

Hi All,
How to set static IP address for JBoss EAP and EWS images in compose.yml file. I have created a sample file, when I try to compose and getting the following error.

version: ‘3.1’

services:
eapdemo:
image: eap-6.3-rhel7.3
networks:
docker1:
ipv4_address: 10.0.0.2

ewsdemo:
image: ews2.1-rhel7.3
ports:
- "10081:80"
networks:
docker1:
ipv4_address: 10.0.0.3

networks:
docker1:
driver: bridge
ipam:

 config:
   - subnet: 10.0.0.0/16
     gateway: 10.0.0.1

environment:
    myews: ewsdemo:10081

(Balamurugant) #2

I am getting the following error, while starting as stack service

docker1 Additional property docker1 is not allowed