-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
65 lines (46 loc) · 1.54 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#FROM rust:latest
#FROM rust:1.36.0 AS build
FROM clux/muslrust AS build
# TODO: map nodetype
ARG nodeType
RUN mkdir /environment/
COPY ./core /environment/
WORKDIR /environment/
RUN rustup target add x86_64-unknown-linux-musl
# just to show it builds, may not need
RUN cargo build --release
# Copy the source and build the application.
COPY ./core/src ./src
####
####
#RUN apt-get install pkg-config libx11-dev libxmu-dev
RUN cargo install --target x86_64-unknown-linux-musl --path .
# rm directories to create blank slate for build
RUN rm -rf /environment/storage/chain
RUN rm -rf /environment/storage/transaction
RUN rm -rf /environment/storage/proposal
RUN rm -rf /environment/storage/state
# create directories as blank folders
RUN mkdir /environment/storage/chain
RUN mkdir /environment/storage/transaction
RUN mkdir /environment/storage/proposal
RUN mkdir /environment/storage/state
################second stage
FROM scratch
# test ports for a, b, and c
EXPOSE 8081
EXPOSE 8082
EXPOSE 8083
#test
#COPY --from=build /usr/local/cargo/bin/core .
#works, copy binary
COPY --from=build /environment/target/x86_64-unknown-linux-musl/release/core .
# copy storage directory
COPY --from=build /environment/storage/ .
COPY --from=build /environment/storage/chain ./storage/chain
COPY --from=build /environment/storage/transaction ./storage/transaction
COPY --from=build /environment/storage/proposal ./storage/proposal
COPY --from=build /environment/storage/state ./storage/state
#ADD --from=build /environment/storage/ ./storage
###############
#CMD ["./core"]