Sync
This commit is contained in:
parent
84484e1f05
commit
d8a47c66f8
1 changed files with 53 additions and 9 deletions
62
readme.md
62
readme.md
|
@ -82,7 +82,7 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm
|
||||||
|
|
||||||
* ### How do I change the size of the data disk? ###
|
* ### How do I change the size of the data disk? ###
|
||||||
|
|
||||||
By default it is 16GB, but you can modify the `DISK_SIZE` setting in your compose file:
|
By default it is 16GB, but to increase it you can modify the `DISK_SIZE` setting in your compose file:
|
||||||
|
|
||||||
```
|
```
|
||||||
environment:
|
environment:
|
||||||
|
@ -93,7 +93,7 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm
|
||||||
|
|
||||||
* ### How do I change the location of the data disk? ###
|
* ### How do I change the location of the data disk? ###
|
||||||
|
|
||||||
By default it resides inside a docker volume, but you can add these lines to your compose file:
|
By default it resides inside a docker volume, but to store it somewhere else you can add these lines to your compose file:
|
||||||
|
|
||||||
```
|
```
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -102,9 +102,20 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm
|
||||||
|
|
||||||
Just replace `/home/user/data` with the path to the folder you want to use for storage.
|
Just replace `/home/user/data` with the path to the folder you want to use for storage.
|
||||||
|
|
||||||
|
* ### How do I change the space reserved by the data disk? ###
|
||||||
|
|
||||||
|
By default the total space for the disk is reserved in advance. If you want to only reserve the space that is actually used by the disk, add these lines:
|
||||||
|
|
||||||
|
```
|
||||||
|
environment:
|
||||||
|
ALLOCATE: "N"
|
||||||
|
```
|
||||||
|
|
||||||
|
This might lower performance a bit, since the image file will need to grow every time new data is added to it.
|
||||||
|
|
||||||
* ### How do I change the amount of CPU/RAM? ###
|
* ### How do I change the amount of CPU/RAM? ###
|
||||||
|
|
||||||
By default an amount of 512MB RAM and 1 vCPU is allocated to the container.
|
By default a single core and 512MB of RAM is allocated to the container.
|
||||||
|
|
||||||
To increase this you can add the following environment variabeles:
|
To increase this you can add the following environment variabeles:
|
||||||
|
|
||||||
|
@ -114,11 +125,13 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm
|
||||||
RAM_SIZE: "2048M"
|
RAM_SIZE: "2048M"
|
||||||
```
|
```
|
||||||
|
|
||||||
* ### How do I give the container a dedicated IP address?
|
* ### How do I give the container its own IP address?
|
||||||
|
|
||||||
By default the container uses bridge networking, and is reachable by the IP of the docker host.
|
By default the container uses bridge networking, and uses the same IP as the docker host.
|
||||||
|
|
||||||
If you want to give it a seperate IP address, create a macvlan network that matches your local subnet, for example:
|
If you want to give it a seperate IP address, create a macvlan network.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker network create -d macvlan \
|
$ docker network create -d macvlan \
|
||||||
|
@ -127,10 +140,41 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm
|
||||||
--ip-range=192.168.0.100/28 \
|
--ip-range=192.168.0.100/28 \
|
||||||
-o parent=eth0 vlan
|
-o parent=eth0 vlan
|
||||||
```
|
```
|
||||||
And change the network of the container to `vlan` in your run command or compose file:
|
Modify these values to match your local subnet.
|
||||||
|
|
||||||
|
Now change the containers configuration in your compose file:
|
||||||
|
|
||||||
```
|
```
|
||||||
--network vlan --ip=192.168.0.100
|
networks:
|
||||||
|
vlan:
|
||||||
|
ipv4_address: 192.168.0.100
|
||||||
```
|
```
|
||||||
|
|
||||||
This also has the advantage that you don't need to do any portmapping anymore.
|
And add the network to the very bottom of your compose file:
|
||||||
|
|
||||||
|
```
|
||||||
|
networks:
|
||||||
|
vlan:
|
||||||
|
external: true
|
||||||
|
```
|
||||||
|
|
||||||
|
This also has the advantage that you don't need to do any portmapping anymore, because all ports will be fully exposed this way.
|
||||||
|
|
||||||
|
NOTE: Docker does not allow communication between the host and the container in a macvlan network. There are some ways to fix that if needed, but they go beyond the scope of this FAQ.
|
||||||
|
|
||||||
|
* ### How can the container get an IP address via DHCP? ###
|
||||||
|
|
||||||
|
First follow the steps to configure the container for macvlan (see above), and then add the following lines to your compose file:
|
||||||
|
|
||||||
|
```
|
||||||
|
environment:
|
||||||
|
DHCP: "Y"
|
||||||
|
devices:
|
||||||
|
- /dev/vhost-net
|
||||||
|
device_cgroup_rules:
|
||||||
|
- 'c 510:* rwm'
|
||||||
|
```
|
||||||
|
|
||||||
|
This will make QEMU retrieve an IP from your router. This will not be the same as the macvlan IP of the container, so to determine which one was assigned to QEMU please check the container logfile or use the devices page of your router for example.
|
||||||
|
|
||||||
|
NOTE: The exact cgroup rule may be different than `510` depending on your system, but the correct rule number will be printed to the logfile in case of error.
|
||||||
|
|
Loading…
Reference in a new issue