-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
44 lines (35 loc) · 1.26 KB
/
Dockerfile
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
43
44
# With this image, only the naive solver will work
ARG SOLVER_BASE=ubuntu:bionic
ARG RUST_BASE=rust-compile
# Build Option 1: Download rust and compile sources
FROM ${SOLVER_BASE} as rust-compile
ONBUILD RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
# common crate requirements
gcc libc-dev libssl-dev pkg-config \
# listener requirements
libpq-dev \
# remove apt package info
&& rm -rf /var/lib/apt/lists/* \
#Install Rust
&& curl https://sh.rustup.rs -sSf | sh -s -- -y \
&& ln -s $HOME/.cargo/bin/* /usr/bin/
ONBUILD COPY dex-contracts/build ./dex-contracts/build
ONBUILD COPY driver ./driver
ONBUILD COPY e2e ./e2e
ONBUILD COPY Cargo.* ./
ONBUILD RUN cargo build
# Build Option 2: Copy already compiled binary from host (used e.g. in travis)
FROM ${SOLVER_BASE} as rust-binary
# Required for listener
ONBUILD RUN apt-get update \
&& apt-get install -y --no-install-recommends libpq-dev libssl1.0.0 libssl-dev ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ONBUILD COPY target/debug/driver stablex
# Trigger actual build
FROM ${RUST_BASE}
# Add Tini
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]