forked from openobserve/openobserve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.amd64
42 lines (35 loc) · 1.59 KB
/
Dockerfile.amd64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# syntax=docker/dockerfile:1
FROM public.ecr.aws/docker/library/node:18.12.1-bullseye as webBuilder
WORKDIR /web
COPY ./web /web/
RUN npm install
RUN NODE_OPTIONS="--max-old-space-size=8192" npm run build
# FROM public.ecr.aws/docker/library/rust:bullseye as builder
FROM public.ecr.aws/zinclabs/rust:bullseye-sccache as builder
ARG AWS_DEFAULT_REGION
ARG AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
# RUN rustup toolchain install nightly-2023-05-21
# RUN rustup default nightly-2023-05-21
# RUN rustup target add x86_64-unknown-linux-gnu
# RUN diff -u <(rustc --print cfg) <(rustc -C target-cpu=native --print cfg)
# ENV SCCACHE_BUCKET=codepipeline-us-west-2-scccache
# ENV SCCACHE_REGION=us-west-2
# ENV SCCACHE_S3_KEY_PREFIX=zincobserve/dev/amd64/
# ENV SCCACHE_NO_DAEMON=1
# ENV SCCACHE_LOG=debug
RUN rustc --version && sccache --version
WORKDIR /app
COPY . /app
COPY --from=webBuilder /web/dist web/dist
RUN --mount=type=cache,target=/root/.cache/sccache du -sh /root/.cache/sccache
RUN --mount=type=cache,target=/root/.cache/sccache cargo build --release --features mimalloc --target x86_64-unknown-linux-gnu \
&& sccache --show-stats \
&& du -sh /root/.cache/sccache
RUN mv /app/target/x86_64-unknown-linux-gnu/release/openobserve /app/target/release/openobserve
# FROM gcr.io/distroless/cc as runtime
FROM public.ecr.aws/debian/debian:bullseye-slim as runtime
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN apt-get install -y curl htop iftop sysstat procps lsof net-tools
RUN update-ca-certificates
COPY --from=builder /app/target/release/openobserve /
CMD ["/openobserve"]