-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Docker image #65
Add Docker image #65
Conversation
7a018da
to
69d243a
Compare
@hwwhww thanks! Just changed the target branch, looks like there is no conflicts. |
How about a .dockerignore file
|
@ltfschoen Thanks for the review+suggestions, just pushed a new commit including them. Also properly switched to the |
de03fe3
to
4351a1f
Compare
Just spent the better part of an hour trying to make a Also, this version is probably better because it produces a smaller image (mine was almost 1GB because I didn't know the right packages to install, so I used buster instead of alpine). Just tested this PR and seems to work fine for me. |
Another useful resource is this https://github.com/stefa2k/prysm-docker-compose. Note that I've also created a PR in this repo showing how I went about setting it all up myself. |
@ltfschoen that setup is what I use to run my validators for Medalla and also the reason why I wanted to dockerize the deposit CLI. Stefan has done a great job making the key import as simple as possible, but it still took a bit of work to get the deposit CLI working, so I thought if only there was a docker image for that, this could literally become a one stop shop for setting up a validator, no futzing around with different compilers etc. required. Unfortunately I did not find your PR there, @ltfschoen? @mgcrea I think one improvement that would be nice to have would be a smaller image size. Yours was 264 MB, which is already a huge improvement over my 957, but I think it could be trimmed down quite a bit using a multi-stage build, which could basically drop the compiler and devtools required for the build process and only contain what's necessary to run the actual CLI. I tried my hand at that, but unfortunately I failed, because my image did not include the compiled eggs, so it wouldn't run. EDIT: after a few more experiments, victory is mine! I added the following lines to the
Basically, this creates a fresh image starting over with the same base, copies the app and the installed Python modules over, and packages that as a runtime image. I ran the CLI and it seemed to be able to generate a key successfully, and the image size went down to about 120 MB. I think this could still go down quite a bit, after all the binary distribution is only about 14 MB zipped. I also tried to make an image just for that, but I couldn't get it to work. However, the image was only 22 MB large, which would be another great improvement. |
@PandaWhisperer FYI this is the PR with what I did #83 |
@ltfschoen oh okay, I misunderstood you then. I thought you made a PR on stefa2k/prysm-docker-compose. |
Is there anything left I can do to help this being merged? Thanks! |
I don’t see anything necessary. Thanks
…On Thu, Aug 20, 2020 at 10:33 PM Olivier Louvignes ***@***.***> wrote:
Is there anything left I can do to help this being merged? Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6WV4WCHHUWXQ7DZBKDHQDSBXTIDANCNFSM4PJAPPHA>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we (EF) may not upload the docker image somewhere officially, I assume that the users have to build the docker image by themselves. That is, we probably should tell them how to build it in the document.
Otherwise, this PR looks good to me. Thank you! 😊
/cc @CarlBeek
README.md
Outdated
@@ -201,6 +201,34 @@ See [here](#arguments) | |||
###### Successful message | |||
See [here](#successful-message) | |||
|
|||
#### Option 4. Use Docker image | |||
|
|||
##### Step 1. Create keys and `deposit_data-*.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the docs tell the user to build the docker image first? (make build_docker
)
Hey @mgcrea 👋 are you still working on it? |
Hey @hwwhww, yes will gladly add any changes required for this to land. I've added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
/cc @CarlBeek would you like to take a look at it before merge?
Looks good to me too. Thanks for your work on this @mgcrea! |
Thank you @mgcrea!
Would you like to help with the CI job? #123 will change the command line interface so we should have dockerfile build in CI. |
Add Docker image
Adds a working
Dockerfile
to generate a ready to use Docker image.Ideally you would have a CI job that does build the image and push automatically on success. If interested I could send another PR doing just that using GitHub actions / CircleCI.