Skip to content

Commit

Permalink
Merge branch 'SAPP-develop' of https://github.com/decenomy/DSW
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed Nov 6, 2023
2 parents d7fc3db + 80f7ea8 commit d2e4e0c
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 4 deletions.
55 changes: 55 additions & 0 deletions contrib/docker/Dockerfile.dsw-linux-arm64-builder
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
83 changes: 83 additions & 0 deletions contrib/docker/Dockerfile.dsw-linux-arm64-wallet
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"]
1 change: 0 additions & 1 deletion contrib/docker/Dockerfile.dsw-linux-x64-builder
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ENV TZ=Etc/UTC
# Update and install necessary packages
RUN apt-get update && \
apt-get install -y \
faketime \
curl \
git \
zip=3.0-11build1 \
Expand Down
12 changes: 9 additions & 3 deletions contrib/docker/Dockerfile.dsw-linux-x64-wallet
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@ RUN make -j$CPU_CORES HOST=x86_64-pc-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

# Run the cli executable to extract the wallet version
RUN src/${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print $5 }' | sed s/v// > /wallet_version
# 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-x64
Expand All @@ -59,7 +65,7 @@ RUN sha256sum $(echo $BASE_NAME)-qt >> SHA256SUMS-Linux-x64.ASC
RUN sha256sum $TICKER-$(cat /wallet_version)-Linux-x64.zip >> SHA256SUMS-Linux-x64.ASC

# To compile and build the container execute docker in this way:
# docker build --progress=plain \
# docker build \
# --build-arg CPU_CORES=<num_cores> \
# --build-arg TICKER=<ticker> \
# --build-arg NAME=<coin_name> \
Expand Down

0 comments on commit d2e4e0c

Please sign in to comment.