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:


  1. 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.

  1. 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.

  1. 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 ?

  • 1
    The first reason that comes to mind is that Docker provides kernel-level virtualization whereas Ethereum clients provide emulation. Docker is completely unsuitable by itself for being a "universal computing platform" because the software running in Docker must be designed for the same computer architecture as the host. With the Ethereum machine and Java machine, the software runs on the emulated (virtual) platform (except where someone has actually built a physical machine for running opcodes for the Ethereum and Java machines, as has been done for Java). Thus, the EVM works on ARM, x86, etc
    – lungj
    Aug 30, 2017 at 17:10
  • 1
    I would add that building an entirely new protocol-level cryptocurrency on top of a third-party system that wasn't build and isn't maintained to support said cyrptocurrency is a bad idea. You are also relying on Docker to not change something that goes against your needs.
    – tayvano
    Sep 11, 2017 at 8:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.