Skip to content

Instantly share code, notes, and snippets.

@petersem
Created July 9, 2022 05:44
Show Gist options
  • Save petersem/d04cfc8a642e98965c59c0ce1263308f to your computer and use it in GitHub Desktop.
Save petersem/d04cfc8a642e98965c59c0ce1263308f to your computer and use it in GitHub Desktop.
Docker: compose macvlan example
# compose.yaml
################
networks:
macv_network:
driver: macvlan
driver_opts:
parent: eth0
ipam:
driver: default
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
services:
nginx:
ports:
- '80:80'
container_name: nginx
mac_address: 02:42:c0:a8:84:22
networks:
macv_network:
ipv4_address: 192.168.1.241
volumes:
- /home/jblogs/docker/nginx/site-content:/usr/share/nginx/html
image: nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment