It behaves differently (the installation succeeds) if you install mysql-server from a bash prompt inside the container. Running the installation as a parameter to `systemd-nspawn` will fail. I have tested this on a 16.04.3 system and an 18.04 system.
I just noticed something especially weird: if I add `dpkg --configure -a` to the end of the `systemd-nspawn` command, then the `apt install` command will reliably finish.
Prepare a base container to be used for the tests:
1. debootstrap bionic bionic
2. rm bionic/etc/resolv.conf
This will always fail:
sudo rm -rf testmysql && sudo cp -a bionic testmysql && sudo systemd-nspawn -D testmysql bash -c 'apt update && apt install mysql-server'
This will always succeed:
sudo rm -rf testmysql && sudo cp -a bionic testmysql && sudo systemd-nspawn -D testmysql bash -c 'apt update && apt install mysql-server; dpkg --configure -a'
It behaves differently (the installation succeeds) if you install mysql-server from a bash prompt inside the container. Running the installation as a parameter to `systemd-nspawn` will fail. I have tested this on a 16.04.3 system and an 18.04 system.
I just noticed something especially weird: if I add `dpkg --configure -a` to the end of the `systemd-nspawn` command, then the `apt install` command will reliably finish.
Prepare a base container to be used for the tests: etc/resolv. conf
1. debootstrap bionic bionic
2. rm bionic/
This will always fail:
sudo rm -rf testmysql && sudo cp -a bionic testmysql && sudo systemd-nspawn -D testmysql bash -c 'apt update && apt install mysql-server'
This will always succeed:
sudo rm -rf testmysql && sudo cp -a bionic testmysql && sudo systemd-nspawn -D testmysql bash -c 'apt update && apt install mysql-server; dpkg --configure -a'