diff --git a/Dockerfile b/Dockerfile
index 1c6132048ffa0f00ea1bc416ac66c8434cd54653..f571063d5f6140eca6d14998fe1ceb51910b3c86 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,6 +4,8 @@ COPY Cargo.toml Cargo.lock ./
 
 # Build with a dummy main to pre-build dependencies
 RUN mkdir src && \
+ sudo chown -R rust:rust . && \
+ sed -i '/test_client/d' Cargo.toml && \
  echo "fn main(){}" > src/main.rs && \
  cargo build --release && \
  rm -r src