Skip to content
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 .dockerignore #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

brownchow
Copy link

I noticed that, if I build from source, the current working directory will generate a target, and it's huge

~/rust/github.com/vi/websocat(master) » du -sh target                                                                                                                                                                              
370M    target

so, if we have already compiled the source code, and then execute docker build -t vi/websocat:v0.1 ., it will send a huge build context to docker daemon, that will slow down our build speed.

docker build -t v1/websocat:v0.1 .                                                                                                                                                        
Sending build context to Docker daemon  385.5MB
Step 1/12 : FROM rust:1.45.0 as cargo-build
........

but when we ignore target dir, the context send to docker daemon is small

docker build -t v1/websocat:v0.1 .                                                                                                                                                        
Sending build context to Docker daemon  1.578MB
Step 1/12 : FROM rust:1.45.0 as cargo-build
 ---> cbcfc3836acd
Step 2/12 : RUN apt-get update &&     apt-get install -y --no-install-recommends musl-tools
.......

that will speed up build progress.

@akostadinov
Copy link
Contributor

Is this still useful? I see .dockerignore was added already just without the md part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants