documentation review
This commit is contained in:
@@ -1,25 +0,0 @@
|
|||||||
# nfs
|
|
||||||
|
|
||||||
## nfs with enviroment variables
|
|
||||||
|
|
||||||
### Docker compose
|
|
||||||
|
|
||||||
```text
|
|
||||||
volumes:
|
|
||||||
etcPihole:
|
|
||||||
name: pihole_etc
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: ${VOLUME_PIHOLE_TYPE}
|
|
||||||
o: ${VOLUME_PIHOLE_O}
|
|
||||||
device: "${VOLUME_PIHOLE_DEVICE}"
|
|
||||||
```
|
|
||||||
|
|
||||||
### .env
|
|
||||||
|
|
||||||
```text
|
|
||||||
#VOLUME_PIHOLE_O="addr=10.10.1.1,rw"
|
|
||||||
#VOLUME_PIHOLE_DEVICE=":/export/docker-volumes/pihole/pihole-etc"
|
|
||||||
#VOLUME_PIHOLE_TYPE="nfs"
|
|
||||||
```
|
|
||||||
|
|
||||||
106
README.md
106
README.md
@@ -1,3 +1,107 @@
|
|||||||
# docker
|
# docker
|
||||||
|
|
||||||
see documentation
|
[TOC]
|
||||||
|
|
||||||
|
## Volumes
|
||||||
|
|
||||||
|
### NFS
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
|
||||||
|
docker-compose.yaml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
volumes:
|
||||||
|
volume00:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: ${VOLUME_TYPE}
|
||||||
|
o: ${VOLUME_O}
|
||||||
|
device: "${VOLUME_DEVICE}"
|
||||||
|
```
|
||||||
|
|
||||||
|
.env
|
||||||
|
|
||||||
|
```text
|
||||||
|
VOLUME_TYPE="nfs"
|
||||||
|
|
||||||
|
# DNS server ip, RW:read and write
|
||||||
|
VOLUME_O="addr=10.10.1.1,rw"
|
||||||
|
|
||||||
|
# Folder on NFS Server
|
||||||
|
## Must exists on nfs server, or security errors when starting container
|
||||||
|
VOLUME_DEVICE=":/export/docker-volumes/volume00"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Network
|
||||||
|
|
||||||
|
### Macvlan
|
||||||
|
|
||||||
|
#### Create
|
||||||
|
|
||||||
|
How to create a docker macvlan network
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# run on host
|
||||||
|
docker network create -d macvlan --subnet=192.168.1.249/24 --gateway=192.168.1.1 -o parent=eth0 macvlan_network
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Host comunication
|
||||||
|
|
||||||
|
if network required between host and docker container on a macvlan docker network
|
||||||
|
|
||||||
|
* Option 1 - Create another macvlan on host
|
||||||
|
|
||||||
|
* Setup vars
|
||||||
|
|
||||||
|
```bash
|
||||||
|
MACVLAN_NAME=macvlan_bridge
|
||||||
|
HOST_ETHERNET_ADP=eth0
|
||||||
|
NETWORK=192.168.1.0/24
|
||||||
|
```
|
||||||
|
|
||||||
|
* Create mavclan adapter
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ip link add $MACVLAN_NAME link $HOST_ETHERNET_ADP type macvlan mode bridge
|
||||||
|
ip addr add $NETWORK dev $MACVLAN_NAME
|
||||||
|
ifconfig $MACVLAN_NAME up
|
||||||
|
```
|
||||||
|
|
||||||
|
* Add routing
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ip route add $CONTAINER_MAVLAN_IP dev $MACVLAN_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
* Delete mavclan adapter
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ifconfig $MACVLAN_NAME down
|
||||||
|
ip link del $MACVLAN_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
* Persisting macvlan configuration
|
||||||
|
Example:
|
||||||
|
* network: 192.168.1.0/24
|
||||||
|
* macvlan name:: macvlan_bridge
|
||||||
|
* macvlan static ip: 192.168.1.240/32
|
||||||
|
* docker containers on macvlan networks:
|
||||||
|
* 192.168.1.254
|
||||||
|
* 192.168.1.253
|
||||||
|
* 192.168.1.250
|
||||||
|
* 192.168.1.248
|
||||||
|
|
||||||
|
```text
|
||||||
|
# create/edit /etc/network/interfaces.d/macvlan_bridge
|
||||||
|
iface macvlan_bridge inet manual
|
||||||
|
pre-up ip link add macvlan_bridge link eth0 type macvlan mode bridge
|
||||||
|
pre-up ip addr add 192.168.1.240/32 dev macvlan_bridge
|
||||||
|
up ip link set macvlan_bridge up
|
||||||
|
post-up ip route add 192.168.1.254 dev macvlan_bridge
|
||||||
|
post-up ip route add 192.168.1.253 dev macvlan_bridge
|
||||||
|
post-up ip route add 192.168.1.252 dev macvlan_bridge
|
||||||
|
post-up ip route add 192.168.1.250 dev macvlan_bridge
|
||||||
|
post-up ip route add 192.168.1.248 dev macvlan_bridge
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user