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

Use multi-stage build dockerfile in datafusion-cli and reduce image size from 2.16GB to 89.9MB #266

Merged
merged 5 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ members = [
"datafusion",
"datafusion-cli",
"datafusion-examples",
"benchmarks",
"benchmarks",
"ballista/rust/client",
"ballista/rust/core",
"ballista/rust/executor",
"ballista/rust/scheduler",
]
]
16 changes: 11 additions & 5 deletions datafusion-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@
# specific language governing permissions and limitations
# under the License.

FROM rust:latest
FROM rust:latest as builder

COPY ./datafusion /usr/src/datafusion

COPY ./datafusion ./usr/src/datafusion
COPY ./datafusion-cli ./usr/src/datafusion-cli
COPY ./datafusion-cli /usr/src/datafusion-cli

WORKDIR /usr/src/datafusion-cli
RUN cargo install --path .

RUN cargo build --release

CMD ["datafusion-cli", "--data-path", "/data"]
FROM debian:buster-slim

COPY --from=builder /usr/src/datafusion-cli/target/release/datafusion-cli /usr/local/bin

ENTRYPOINT ["datafusion-cli"]

CMD ["--data-path", "/data"]