-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
39 lines (30 loc) · 1.36 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
FROM ghcr.io/xmtp/rust:latest
ARG CARGO_INCREMENTAL
USER xmtp
ENV USER=xmtp
RUN sudo apt update && sudo apt install -y pkg-config openssl libssl-dev
COPY --from=ghcr.io/xmtp/foundry:latest /home/xmtp/.foundry/bin/anvil /usr/local/bin/anvil
ARG PROJECT=xps
WORKDIR /workspaces/${PROJECT}
COPY --chown=xmtp:xmtp . .
ENV PATH=~${USER}/.cargo/bin:$PATH
ENV USER=xmtp
RUN yamlfmt -lint .github/workflows/*.yml
ENV CARGO_INCREMENTAL=${CARGO_INCREMENTAL:-1}
RUN cargo check
RUN cargo fmt --check
RUN cargo clippy --all-features --no-deps -- -D warnings
RUN cargo test --workspace --all-features
RUN CARGO_TARGET_DIR=/workspaces/${PROJECT}/target cargo install --path xps --bin=xps --root=~${USER}/.cargo/
RUN valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ~${USER}/.cargo/bin/xps --help
CMD RUST_LOG=info cargo run -- --host 0.0.0.0 --port 8080
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="rustdev" \
org.label-schema.description="Rust Development Container" \
org.label-schema.url="https://github.com/xmtp/xps-gateway" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="[email protected]:xmtp/xps-gateway.git" \
org.label-schema.vendor="xmtp" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
org.opencontainers.image.description="Rust Development Container"