-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile.dsw-linux-arm64-wallet
85 lines (72 loc) · 3.56 KB
/
Dockerfile.dsw-linux-arm64-wallet
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# FROM decenomy/dsw-linux-arm64-builder:latest
FROM decenomy/dsw-linux-arm64-builder@sha256:ff64795ac415846c3576ba98526266ec0cf8c9810c695e2644f460f6070de678
# ARG for specifying the number of cores
ARG CPU_CORES=1
# ARG for specifying the coin parameters
ARG TICKER=BIR
ARG NAME=Birake
ARG BASE_NAME=birake
ARG TARGET=master
# Clone the repository
RUN if [ ! -d $TICKER ]; then \
git clone https://github.com/decenomy/$TICKER; \
fi
# Switch to the repository directory
WORKDIR /$TICKER
# Check out a specific version if needed
RUN git checkout -B $TARGET
RUN git pull origin $TARGET
# Run Git commands to extract the timestamps
RUN git log -1 --format="%at" | xargs -I{} date -d @{} "+%Y-%m-%d %H:%M:%S" > /git_timestamp
RUN git log -1 --format="%at" | xargs -I{} date -d @{} "+%Y%m%d%H%M.%S" > /git_timestamp_touch
# Run the configuration script
RUN PATH=${WRAP_DIR}:${PATH} ./autogen.sh && \
PATH=${WRAP_DIR}:${PATH} ./configure \
--prefix=/DSW/depends/aarch64-linux-gnu \
--disable-debug \
--disable-bench \
--disable-tests \
--disable-man \
--enable-zmq \
--enable-static \
--with-gui \
--enable-glibc-back-compat \
--enable-upnp-default \
LDFLAGS="-static-libstdc++"
# Compile the binaries
RUN PATH=${WRAP_DIR}:${PATH} make -j$CPU_CORES HOST=aarch64-linux-gnu
# Extract the wallet version
RUN grep "define(_CLIENT_VERSION_MAJOR" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' > /wallet_version
RUN echo -n "." >> /wallet_version
RUN grep "define(_CLIENT_VERSION_MINOR" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' >> /wallet_version
RUN echo -n "." >> /wallet_version
RUN grep "define(_CLIENT_VERSION_REVISION" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' >> /wallet_version
RUN echo -n "." >> /wallet_version
RUN grep "define(_CLIENT_VERSION_BUILD" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' >> /wallet_version
# Create deploy files
RUN mkdir -p deploy/linux-arm64
RUN PATH=${WRAP_DIR}:${PATH} aarch64-linux-gnu-objcopy --strip-all src/$(echo $BASE_NAME)d
RUN PATH=${WRAP_DIR}:${PATH} aarch64-linux-gnu-objcopy --strip-all src/$(echo $BASE_NAME)-cli
RUN PATH=${WRAP_DIR}:${PATH} aarch64-linux-gnu-objcopy --strip-all src/$(echo $BASE_NAME)-tx
RUN PATH=${WRAP_DIR}:${PATH} aarch64-linux-gnu-objcopy --strip-all src/qt/$(echo $BASE_NAME)-qt
RUN cp src/$(echo $BASE_NAME)d src/$(echo $BASE_NAME)-cli src/$(echo $BASE_NAME)-tx src/qt/$(echo $BASE_NAME)-qt /$TICKER/deploy/linux-arm64
RUN find /$TICKER/deploy/linux-arm64 -type f -exec touch -t $(cat /git_timestamp_touch) {} +
WORKDIR /$TICKER/deploy/linux-arm64
RUN PATH=${WRAP_DIR}:${PATH} zip -X $TICKER-$(cat /wallet_version)-Linux-arm64.zip $(echo $BASE_NAME)d $(echo $BASE_NAME)-cli $(echo $BASE_NAME)-tx $(echo $BASE_NAME)-qt
RUN sha256sum $(echo $BASE_NAME)d >> SHA256SUMS-Linux-arm64.ASC
RUN sha256sum $(echo $BASE_NAME)-cli >> SHA256SUMS-Linux-arm64.ASC
RUN sha256sum $(echo $BASE_NAME)-tx >> SHA256SUMS-Linux-arm64.ASC
RUN sha256sum $(echo $BASE_NAME)-qt >> SHA256SUMS-Linux-arm64.ASC
RUN sha256sum $TICKER-$(cat /wallet_version)-Linux-arm64.zip >> SHA256SUMS-Linux-arm64.ASC
# To compile and build the container execute docker in this way:
# docker build \
# --build-arg CPU_CORES=<num_cores> \
# --build-arg TICKER=<ticker> \
# --build-arg NAME=<coin_name> \
# --build-arg BASE_NAME=<base_name> \
# --build-arg TARGET=<branch|commit|tag> \
# -f Dockerfile.dsw-linux-arm64-wallet .
# To run the container use:
# docker run -it <image_id>
# Set the entry point if you want to interact within the container
ENTRYPOINT ["bash"]