anton-rs / op-up

Composable OP Stack Orchestration
https://stack.anton.systems
MIT License
41 stars 2 forks source link

feat: first docker container running #67

Closed merklefruit closed 11 months ago

merklefruit commented 11 months ago

We can now boot Geth from inside Docker by running the opup command. "It works on my machine" (but I can't make any reliability remarks yet)

Changes

The main addition is the create_dockerfile_build_context() function in the composer crate. It allows us to generate a "build context" for any image we might want to build from scratch. You just need to supply a Dockerfile and any necessary files that are referenced inside it. They are then added to a tarball archive and gzipped, and fed to the native build_image Docker API.

Also now we can pattern match on client enum variants to have separate functions for each of them:

match self.l1_client {
    L1Client::Geth => self.start_geth().await?,
    _ => unimplemented!("l1 client not implemented: {}", self.l1_client),
}

I realize this is bad for client generalization (aka: bring your own client by just touching a TOML) but we're not there yet!