vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
6.74k stars 261 forks source link

add .dockerignore #97

Open brownchow opened 3 years ago

brownchow commented 3 years ago

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 commented 2 months ago

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