This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| kvm_and_docker_on_one_host [2019/07/26 14:39] – herwarth | kvm_and_docker_on_one_host [2020/04/12 09:10] (current) – [ZFS] herwarth | ||
|---|---|---|---|
| Line 183: | Line 183: | ||
| } | } | ||
| </ | </ | ||
| - | | + | When we stop docker to manipulate iptables it will not add the masquerade rule to the docker0 bridge. We need this iptables rule to make docker build work again. So first we are going to add the iptables rule manually. Find out which subnet is connected to docker0 |
| + | |||
| + | ip a s docker0 | ||
| + | < | ||
| + | 11: docker0: < | ||
| + | link/ether 02: | ||
| + | inet 172.17.0.1/ | ||
| + | | ||
| + | inet6 fe80:: | ||
| + | | ||
| + | </ | ||
| + | In this case the subnet is 172.17.0.0/ | ||
| + | iptables -t nat -A POSTROUTING -s 172.17.0.0/ | ||
| + | |||
| + | Now we have the rule added. Make it persistent. First install iptables-persistent | ||
| + | apt install iptables-persistent | ||
| + | It will tell you it created rules in: / | ||
| + | Check the rules.v4 file for the masquerade rule | ||
| + | |||
| + | cat / | ||
| + | < | ||
| + | # Generated by iptables-save v1.6.1 on Fri Jul 26 18:19:47 2019 | ||
| + | *nat | ||
| + | :PREROUTING ACCEPT [468: | ||
| + | :INPUT ACCEPT [22: | ||
| + | :OUTPUT ACCEPT [8:601] | ||
| + | : | ||
| + | -A POSTROUTING -s 172.17.0.0/ | ||
| + | COMMIT | ||
| + | # Completed on Fri Jul 26 18:19:47 2019 | ||
| + | # Generated by iptables-save v1.6.1 on Fri Jul 26 18:19:47 2019 | ||
| + | *filter | ||
| + | :INPUT ACCEPT [2328: | ||
| + | :FORWARD ACCEPT [3836: | ||
| + | :OUTPUT ACCEPT [1473: | ||
| + | : | ||
| + | -A FORWARD -j DOCKER-USER | ||
| + | -A DOCKER-USER -j RETURN | ||
| + | COMMIT | ||
| + | # Completed on Fri Jul 26 18:19:47 2019 | ||
| + | </ | ||
| + | ====ZFS==== | ||
| + | When you have a ZFS pool you want to use for storage | ||
| + | < | ||
| + | systemctl | ||
| + | rm -rf / | ||
| + | zfs create -o mountpoint=/ | ||
| + | </ | ||
| + | <code - / | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | < | ||
| + | systemctl start docker | ||
| + | </ | ||
| + | Check with docker info | ||
| + | < | ||
| + | < | ||
| + | Client: | ||
| + | Debug Mode: false | ||
| + | |||
| + | Server: | ||
| + | | ||
| + | Running: 0 | ||
| + | Paused: 0 | ||
| + | Stopped: 0 | ||
| + | | ||
| + | | ||
| + | | ||
| + | Zpool: data | ||
| + | Zpool Health: ONLINE | ||
| + | Parent Dataset: data/docker | ||
| + | Space Used By Parent: 98304 | ||
| + | Space Available: 965292744704 | ||
| + | Parent Quota: no | ||
| + | Compression: | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | </ | ||
| ====Networks==== | ====Networks==== | ||
| In our example we are not going to use containers in the routed subnet bridge called internet | In our example we are not going to use containers in the routed subnet bridge called internet | ||
| Line 206: | Line 287: | ||
| 320e38274915 | 320e38274915 | ||
| </ | </ | ||
| + | |||
| + | {{tag> | ||