-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'SAPP-develop' of https://github.com/decenomy/DSW
- Loading branch information
Showing
4 changed files
with
147 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Use a base image (Ubuntu 20.04) | ||
# FROM ubuntu:20.04 | ||
FROM ubuntu@sha256:218bb51abbd1864df8be26166f847547b3851a89999ca7bfceb85ca9b5d2e95d | ||
|
||
# Set environment variables | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Etc/UTC | ||
|
||
# Update and install necessary packages | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
curl \ | ||
git \ | ||
zip=3.0-11build1 \ | ||
unzip \ | ||
build-essential=12.8ubuntu1.1 \ | ||
libtool=2.4.6-14 \ | ||
bsdmainutils=11.1.2ubuntu3 \ | ||
autotools-dev=20180224.1 \ | ||
autoconf=2.69-11.1 \ | ||
pkg-config=0.29.1-0ubuntu4 \ | ||
automake=1:1.16.1-4ubuntu6 \ | ||
python3 \ | ||
g++-aarch64-linux-gnu=4:9.3.0-1ubuntu2 \ | ||
g++-8-aarch64-linux-gnu=8.4.0-3ubuntu1cross1 \ | ||
gcc-8-aarch64-linux-gnu=8.4.0-3ubuntu1cross1 \ | ||
binutils-aarch64-linux-gnu=2.34-6ubuntu1.6 \ | ||
g++-8-multilib=8.4.0-3ubuntu2 \ | ||
gcc-8-multilib=8.4.0-3ubuntu2 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone the repository | ||
RUN git clone https://github.com/decenomy/DSW.git | ||
|
||
# Switch to the repository directory | ||
WORKDIR /DSW/depends | ||
|
||
# ARG for specifying the number of cores | ||
ARG CPU_CORES=1 | ||
|
||
# Compile the depends folder | ||
RUN make -j$(echo $CPU_CORES) HOST=aarch64-linux-gnu | ||
|
||
#Set the work dir to the root folder | ||
WORKDIR / | ||
|
||
# Set the entry point if you want to interact within the container | ||
ENTRYPOINT ["bash"] | ||
|
||
# Build it with: | ||
# docker build --build-arg CPU_CORES=<num_cores> -t decenomy/dsw-linux-arm64-builder -f Dockerfile.dsw-linux-arm64-builder . | ||
# Publish with: | ||
# docker login | ||
# docker push decenomy/dsw-linux-arm64-builder:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# FROM decenomy/dsw-linux-arm64-builder:latest | ||
FROM decenomy/dsw-linux-arm64-builder@sha256:8cb48477a258dc5f98a002f46e41c888b07a0f93e63110f8c1e9eb452ec6a529 | ||
|
||
# ARG for specifying the number of cores | ||
ARG CPU_CORES=1 | ||
|
||
# ARG for specifying the coin parameters | ||
ARG TICKER=SAPP | ||
ARG NAME=Sapphire | ||
ARG BASE_NAME=sapphire | ||
ARG TARGET=master | ||
|
||
# Makes the QT build deterministic | ||
ENV QT_RCC_SOURCE_DATE_OVERRIDE=1 | ||
|
||
# Clone the repository | ||
RUN git clone https://github.com/decenomy/$TICKER | ||
|
||
# Switch to the repository directory | ||
WORKDIR /$TICKER | ||
|
||
# Check out a specific version if needed | ||
RUN git checkout $TARGET | ||
|
||
# Run the configuration script | ||
RUN ./autogen.sh && \ | ||
./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 \ | ||
LDFLAGS="-static-libstdc++" | ||
|
||
# Compile the binaries | ||
RUN make -j$CPU_CORES HOST=aarch64-linux-gnu | ||
|
||
# Run Git commands to extract the timestamp | ||
RUN git log -1 --format="%at" | xargs -I{} date -d @{} +%Y%m%d%H%M.%S > /git_timestamp | ||
|
||
# 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 aarch64-linux-gnu-objcopy --strip-all src/$(echo $BASE_NAME)d | ||
RUN aarch64-linux-gnu-objcopy --strip-all src/$(echo $BASE_NAME)-cli | ||
RUN aarch64-linux-gnu-objcopy --strip-all src/$(echo $BASE_NAME)-tx | ||
RUN 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) {} + | ||
WORKDIR /$TICKER/deploy/linux-arm64 | ||
RUN 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters