-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
116 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# install VirtualMachine | ||
|
||
Both WSL1 and WSL2 add some weird network & fs hack to smuggle data ins and outs. | ||
|
||
So use HyperV directly (or other VM software like VirtualBox) can be better when config dives deeper, | ||
and backup/reuse is easier as whole system is in one huge file. | ||
|
||
The idea is config a VM with an additional local 10.42.1.X network, for host to, | ||
everything else is by default separated, like net & fs. | ||
|
||
So this VM will have two network switch/device connected: | ||
- an external network, random ip, for connect to Internet | ||
- a internal/local network, on 10.42.1.X ip range: gate at 10.42.1.0, host should be at 10.42.1.1 and VM at 10.42.1.2 | ||
|
||
Here are the additional config required in VM linux: | ||
|
||
```shell | ||
# /etc/systemd/network/00-local-10.42.1.2.network | ||
|
||
[Match] | ||
MACAddress=00:00:22:22:44:44 | ||
# Name=eth1 | ||
# Name=enp0s8 | ||
|
||
[Network] | ||
DHCP=no | ||
LinkLocalAddressing=no | ||
|
||
[Address] | ||
Address=10.42.1.2/24 | ||
Scope=host | ||
``` | ||
|
||
Note in the `Match` section, a static mac address is simpler to set from host side, | ||
the net device name may change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,25 +7,48 @@ check: https://docs.docker.com/config/containers/logging/configure/#configure-th | |
basically run `sudo mkdir -p /etc/docker/ && sudo nano /etc/docker/daemon.json` and add: | ||
```json | ||
{ | ||
"log-driver": "json-file", | ||
"log-opts": { "max-size": "8m", "max-file": "4" } | ||
"experimental": true, "features": { "buildkit": true }, | ||
"log-driver": "json-file", "log-opts": { "max-size": "8m", "max-file": "4" } | ||
} | ||
``` | ||
Note: should restart `dockerd`, and re-create existing container for default log config to fully apply | ||
|
||
#### install `[email protected]` | ||
```json5 | ||
{ | ||
// change root | ||
"data-root": "/mnt/some-disk/docker", | ||
|
||
// enable latest features | ||
"experimental": true, "features": { "buildkit": true } | ||
} | ||
``` | ||
|
||
#### install `docker-compose@2` | ||
|
||
because docker-compose V2 is still not stable & reasonable enough (20220825) | ||
use docker-compose V2 for faster compose | ||
https://docs.docker.com/compose/install/standalone/ | ||
|
||
```shell | ||
sudo curl \ | ||
-L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64" \ | ||
-L "https://github.com/docker/compose/releases/download/v2.29.0/docker-compose-linux-$(uname -m)" \ | ||
-o "/usr/local/bin/docker-compose" | ||
sudo chmod +x "/usr/local/bin/docker-compose" | ||
[[ -f /usr/lib/libcrypt.so.1 ]] || ( echo 'missing "/usr/lib/libcrypt.so.1"'; ls -al /usr/lib/libcrypt.*; sudo ln -sfT libcrypt.so /usr/lib/libcrypt.so.1 ) # patch old python lib for arch-linux | ||
docker-compose -v | ||
``` | ||
|
||
#### install `[email protected]` | ||
|
||
because docker-compose V2 is still not stable & reasonable enough (20220825) | ||
|
||
```shell | ||
sudo curl \ | ||
-L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-$(uname -m)" \ | ||
-o "/usr/local/bin/docker-compose" | ||
sudo chmod +x "/usr/local/bin/docker-compose" | ||
[[ -f /usr/lib/libcrypt.so.1 ]] || ( echo 'missing "/usr/lib/libcrypt.so.1"'; ls -al /usr/lib/libcrypt.*; sudo ln -sfT libcrypt.so /usr/lib/libcrypt.so.1 ) # patch old python lib for arch-linux | ||
docker-compose -v | ||
``` | ||
|
||
#### WSL2 | ||
|
||
for WSL2 Debian extra patch will be needed: https://github.com/microsoft/WSL/discussions/4872#discussioncomment-76635 | ||
|