I'm trying to understand what are the constraints that wouldn't allow a Docker container to be used instead of creating the specific Ethereum Virtual Machine.
I followed this link:
- It has to run identically on all full nodes.
Docker provides images capability. Images are built deterministically with a script. Every full node can start with the same base image, and dapps/contracts would be installed on top of that shared image with a publically available script. Each dapp/contract would run in a separate Docker container.
- We need to keep track of how much computation effort a contract uses.
Docker provides monitoring and resource limiting tools for RAM, I/O and disk. The same approach of max-gas and upfront gas payments with the reimbursement at the end of transaction, or a transaction rollback if it ran out of gas, could apply. If a Docker container uses too many resources, it can be paused and rolled back to a previous snapshot.
- We need to keep track of Ethereum state, and it has to be rewindable.
Docker provides copy-on-write instant snapshots. We could do a snapshot after each transaction, and after each block. So we could rollback both individual transactions and block chains that lost proof-of-work race with other nodes.
and I found the comments from @tenaciousmv very reasonable. However any technical explanation of why this can not be accomplished ?
I understand why something like Virtual Box wouldnt work because of the need for lightweight nodes, but why it could not be used container technology ?