ip addr
apt install net-tools
ifconfig -a
# NAT
auto enp0s3
iface enp0s3 inet dhcp
# Internal network
auto enp0s8
iface enp0s8 inet static
address 192.168.100.10
netmask 255.255.255.0
/etc/init.d/networking restart
# NAT
auto enp0s3
iface enp0s3 inet dhcp
# Internal network
auto enp0s8
iface enp0s8 inet static
address 192.168.100.20
netmask 255.255.255.0
/etc/init.d/networking restart
version: '3.7'
networks:
default:
name: test
driver: bridge
ipam:
driver: default
config:
- subnet: 172.22.11.0/24
driver_opts:
com.docker.network.bridge.name: br-test
volumes:
data:
conf:
services:
db:
image: mariadb:10.5.6
hostname: db
container_name: db
expose:
- 3306
volumes:
# - ./data:/var/lib/mysql # bind mount for MySQL data
- data:/var/lib/mysql # volume for MySQL data
- conf:/etc/mysql # volume for MySQL configuration files
# - ./my.cnf:/etc/mysql/my.cnf # Using a custom MySQL configuration file
environment:
- MYSQL_ROOT_PASSWORD=1
- MYSQL_DATABASE=test
- MYSQL_USER=test
- MYSQL_PASSWORD=test
restart: always
version: '3.7'
networks:
default:
name: test
driver: bridge
ipam:
driver: default
config:
- subnet: 172.22.11.0/24
driver_opts:
com.docker.network.bridge.name: br-test
volumes:
nginx:
services:
nginx:
image: nginx:latest
hostname: nginx
container_name: nginx
ports:
- "127.0.0.1:80:80"
volumes:
- nginx:/etc/nginx
restart: always
DRIVER VOLUME NAME
local test_nginx
[
{
"CreatedAt": "2020-10-09T14:23:25+03:00",
"Driver": "local",
"Labels": {
"com.docker.compose.project": "test",
"com.docker.compose.version": "1.25.3",
"com.docker.compose.volume": "nginx"
},
"Mountpoint": "/var/lib/docker/volumes/test_nginx/_data",
"Name": "test_nginx",
"Options": null,
"Scope": "local"
}
]
total 40
drwxr-xr-x 2 root root 4096 жов 9 14:23 conf.d
-rw-r--r-- 1 root root 1007 тра 26 18:00 fastcgi_params
-rw-r--r-- 1 root root 2837 тра 26 18:00 koi-utf
-rw-r--r-- 1 root root 2223 тра 26 18:00 koi-win
-rw-r--r-- 1 root root 5231 тра 26 18:00 mime.types
lrwxrwxrwx 1 root root 22 тра 26 18:01 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 тра 26 18:01 nginx.conf
-rw-r--r-- 1 root root 636 тра 26 18:00 scgi_params
-rw-r--r-- 1 root root 664 тра 26 18:00 uwsgi_params
-rw-r--r-- 1 root root 3610 тра 26 18:00 win-utf
все решаеться с помощью iptables + ip route