-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add dockerfile to build greptimedb container image (#194)
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# macOS trash | ||
.DS_Store | ||
|
||
# Visual Studio Code | ||
.vscode/ | ||
.devcontainer/ | ||
|
||
# Eclipse files | ||
.classpath | ||
.project | ||
.settings/** | ||
|
||
# Vim swap files | ||
*.swp | ||
|
||
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA | ||
.idea/ | ||
*.iml | ||
out/ | ||
|
||
# Rust | ||
target/ | ||
|
||
# Git | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM ubuntu:22.04 as builder | ||
|
||
ENV LANG en_US.utf8 | ||
WORKDIR /greptimedb | ||
|
||
# Install dependencies. | ||
RUN apt-get update && apt-get install -y \ | ||
libssl-dev \ | ||
protobuf-compiler \ | ||
curl \ | ||
build-essential \ | ||
pkg-config | ||
|
||
# Install Rust. | ||
SHELL ["/bin/bash", "-c"] | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y | ||
ENV PATH /root/.cargo/bin/:$PATH | ||
|
||
# Build the project in release mode. | ||
COPY . . | ||
RUN cargo build --release | ||
|
||
# Export the binary to the clean image. | ||
# TODO(zyy17): Maybe should use the more secure container image. | ||
FROM ubuntu:22.04 as base | ||
|
||
WORKDIR /greptimedb | ||
COPY --from=builder /greptimedb/target/release/greptime /greptimedb/bin/ | ||
ENV PATH /greptimedb/bin/:$PATH | ||
|
||
ENTRYPOINT [ "greptime" ] | ||
CMD [ "datanode", "start"] |