-
Notifications
You must be signed in to change notification settings - Fork 937
chore: Add Dockerfile.dev for local development #8295
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
Conversation
|
Note: the local_testnet kurtosis script has not been changed and still uses Dockerfile |
|
Thanks @kevaundray, I haven't had a chance to try it out, but this is great! |
|
|
||
| COPY . . | ||
| # Persist the registry and target file across builds. See: https://docs.docker.com/build/cache/optimize/#use-cache-mounts | ||
| RUN --mount=type=cache,target=/usr/local/cargo/registry \ |
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.
Nice I've used this a few times and it seems to have improved. (My machine is slow so I haven't really got enough iterations for measurements)
I noticed the link you provided also suggests mounting this directory, should we include it too?
/usr/local/cargo/git/db
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.
ah so this caches the bare git repos and commits etc, so likely not much time savings in terms of computation. I think we can experiment using this version - I'll make a PR to update the startup script to use this doclerfile.
jimmygchen
left a comment
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.
This is great, thanks for the PR @kevaundray !
Issue Addressed
Currently whenever we build the
Dockerfilefile for local development using kurtosis , it recompiles everything on my laptop, even if no changes are made. This takes about 120 seconds on my laptop (might be faster on others).Proposed Changes
Conservatively, I created a new Dockerfile.dev, so that the original file is kept the same, even though its pretty similar.
This uses
--mount-type=cachesaving the target and registry folder across builds.Usage
docker build -f Dockerfile.dev -t lighthouse:dev .Additional Info