mirror of
https://github.com/valeriansaliou/sonic.git
synced 2022-10-24 19:50:51 +03:00
27 lines
580 B
Docker
27 lines
580 B
Docker
FROM rust:slim-bullseye AS build
|
|
|
|
RUN apt-get update
|
|
RUN apt-get install -y build-essential clang
|
|
|
|
RUN rustup --version
|
|
RUN rustup component add rustfmt
|
|
|
|
RUN rustc --version && \
|
|
rustup --version && \
|
|
cargo --version
|
|
|
|
WORKDIR /app
|
|
COPY . /app
|
|
RUN cargo clean && cargo build --release --target x86_64-unknown-linux-gnu
|
|
RUN strip ./target/x86_64-unknown-linux-gnu/release/sonic
|
|
|
|
FROM gcr.io/distroless/cc
|
|
|
|
WORKDIR /usr/src/sonic
|
|
|
|
COPY --from=build /app/target/x86_64-unknown-linux-gnu/release/sonic /usr/local/bin/sonic
|
|
|
|
CMD [ "sonic", "-c", "/etc/sonic.cfg" ]
|
|
|
|
EXPOSE 1491
|