Skip to content

Instantly share code, notes, and snippets.

@ovuruska
Created January 27, 2021 12:03
Show Gist options
  • Save ovuruska/60fb26f1f7c8ae7fb860b28a63f51a5e to your computer and use it in GitHub Desktop.
Save ovuruska/60fb26f1f7c8ae7fb860b28a63f51a5e to your computer and use it in GitHub Desktop.
Networking example in docker-compose
services:
iot_1:
build:
context: .
dockerfile: iot.Dockerfile
networks:
closed_network:
ipv4_address: 10.5.0.2
iot_2:
build:
context: .
dockerfile: iot.Dockerfile
networks:
closed_network:
ipv4_address: 10.5.0.3
iot_3:
build:
context: .
dockerfile: iot.Dockerfile
networks:
closed_network:
ipv4_address: 10.5.0.4
iot_4:
build:
context: .
dockerfile: iot.Dockerfile
networks:
closed_network:
ipv4_address: 10.5.0.5
pc:
depends_on:
- iot_1
- iot_2
- iot_3
- iot_4
build:
context: .
dockerfile: pc.Dockerfile
networks:
closed_network:
ipv4_address: 10.5.0.6
networks:
closed_network:
driver: bridge
ipam:
config:
- subnet : 10.5.0.0/16
gateway : 10.5.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment