Skip to content
Open
Changes from all 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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM rust:latest AS builder
RUN apt update && apt install -y nodejs npm
WORKDIR /app

COPY . /app/
RUN --mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/ \
cargo build --release --all-targets

RUN strip /app/target/release/edgelinkd
RUN mkdir /export && \
cp $(ldd /app/target/release/edgelinkd | grep -ve 'libc\.so' -e 'ld-linux' -e 'vdso\.so' | sed -e s/'.*=> '// -e s/' (0x.*'//) /export

FROM debian:bookworm-slim as release
RUN mkdir -p /app/target/
WORKDIR /app
COPY --from=builder /app/target/release/edgelinkd .
COPY --from=builder /app/target/ui_static /app/target/ui_static
COPY --from=builder /export /usr/local/lib
RUN ldconfig
EXPOSE 1888

CMD ["./edgelinkd"]