Sometimes when you update an OS on rpi4 it will brick the ablity to use or install docker would require an reinstall of the OS less you are very good with linux, Also I would install the server version of ubuntu on the rpi4.
It’s hard to tell if you used the right command to add I see one error you should uninstall docker and try again and make sure you copy and paste all the commands.
You should check out this to setup node instead of using docker.