Skip to content

Commit

Permalink
Dockerfile release
Browse files Browse the repository at this point in the history
  • Loading branch information
jordy25519 committed Oct 4, 2024
1 parent 692c12b commit 9f3fe21
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ RUN apt-get update && apt-get install -y libgcc1
WORKDIR /build
COPY . .
RUN rustup component add rustfmt && rustup install 1.76.0-x86_64-unknown-linux-gnu
# RUN curl -L https://github.com/user-attachments/files/17126152/libdrift_ffi_sys.so.zip > ffi.zip && unzip ffi.zip && cp libdrift_ffi_sys.so /usr/local/lib
RUN curl -L https://github.com/user-attachments/files/17126152/libdrift_ffi_sys.so.zip > ffi.zip && unzip ffi.zip && cp libdrift_ffi_sys.so /usr/local/lib

# DEV: choose to build drift system libs from source or not
# a) default: use prebuilt lib (faster build time)
# RUN CARGO_DRIFT_FFI_PATH="/usr/local/lib" cargo build --debug
RUN CARGO_DRIFT_FFI_PATH="/usr/local/lib" cargo build --release
# b) build libdrift_ffi from source (slower build time)
RUN CARGO_DRIFT_FFI_STATIC=1 cargo build
RUN ./target/debug/drift-gateway --help
# RUN CARGO_DRIFT_FFI_STATIC=1 cargo build --release
# RUN ./target/release/drift-gateway --help

RUN cp /lib/x86_64-linux-gnu/libgcc_s.so.1 /build/target/debug/
RUN cp /lib/x86_64-linux-gnu/libgcc_s.so.1 /build/target/release/

FROM debian:12
COPY --from=builder /build/target/debug/libgcc_s.so.1 /lib/
COPY --from=builder /build/target/release/libgcc_s.so.1 /lib/
COPY --from=builder /usr/local/lib/libdrift_ffi_sys.so /lib/
COPY --from=builder /build/target/debug/drift-gateway /bin/drift-gateway
COPY --from=builder /build/target/release/drift-gateway /bin/drift-gateway
RUN apt-get update && apt-get install -y curl && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
ENTRYPOINT ["/bin/drift-gateway"]

0 comments on commit 9f3fe21

Please sign in to comment.