dapphub / dapptools

Dapp, Seth, Hevm, and more
https://dapp.tools
2.09k stars 324 forks source link

Use Nix infra to create Docker images #422

Closed asymmetric closed 2 years ago

asymmetric commented 4 years ago

I think we should rm the dockerfiles. If we want to provide container images we should produce them with nix using buildDockerImage.

Originally posted by @xwvvvvwx in https://github.com/dapphub/dapptools/pull/377#issuecomment-656076760

d-xo commented 4 years ago

Do we even need dockerfiles at all?

MrChico commented 4 years ago

Some may be interested in having dockerimages in their ci if they still use docker in the 21st century. I think we should only bother if someone actually requests it tho

d-xo commented 4 years ago

producing docker images with nix is fairly trivial, pushing them somewhere useful and supporting them is probably more annoying.

I’m also in favour of just removing them for now.

d-xo commented 4 years ago

I spent some time today working on this with the aim of being able to include hevm in these benchmarks.

In general the experience was more annoying than I expected, and I'm not sure that we will be able to have fully functional docker images built automatically in github actions.

You can see my progress in this branch: https://github.com/dapphub/dapptools/compare/docker

dapp --use and related commands currently fail in these images with error: cannot figure out user name, and according to the nixpkgs manual (see here), adding a user to a nix built docker image must be done using runAsRoot, which requires the kvm capability on the build machine, which according to this issue is currently not possible in github actions.

Other functionality seems to work ok, so it's not super fundamental, but I would also rather not ship official docker images that are only half working. In general I think it's probably more useful for our use case to pursue a static hevm binary that can be curled into a docker image if required.

Also buildLayeredImage fails because it uses jshon which we override to jays in our overlay, which is a little annoying.

d-xo commented 4 years ago

or actually maybe it's ok for now to just ship an hevm docker image only, and leave seth and dapp out for now...

MrChico commented 4 years ago

Yeah, I'd be happy with hevm for now!

endersonmaia commented 2 years ago

Some may be interested in having dockerimages in their ci ...

I am interested, and maybe I'll need to build my own image and push to my own registry for now.

... if they still use docker in the 21st century.

What are the alternatives ?

I'm planning on using GitHub Actions, and I need to call a smart contract to check something on the blockchain that will be used during the release of some artifacts. So a seth docker image would be nice.

... I think we should only bother if someone actually requests it tho

Consider this a request! :smiley:

d-xo commented 2 years ago

I don't think we are interested in adding official docker images at the moment.

Perhaps https://github.com/OdysLam/ddapptools fits your needs? Otherwise foundry offers an offical docker image: https://github.com/gakonst/foundry/pkgs/container/foundry.