Skip to content

Commit

Permalink
Monero 0.18.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rblaine95 committed Jul 22, 2022
1 parent 3749832 commit c1c3509
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 35 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [workflow_dispatch, push]

env:
IMAGE_NAME: monero
PLATFORMS: amd64 arm64/v8 arm/v7
PLATFORMS: amd64 arm64/v8

jobs:
build:
Expand All @@ -15,13 +15,23 @@ jobs:
include:
- platform: amd64
- platform: arm64/v8
- platform: arm/v7
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Install Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Builder
id: build
run: |
Expand All @@ -41,6 +51,9 @@ jobs:
--platform linux/${{ matrix.platform }} \
--build-arg BUILD_THREADS=3 \
--cache-to type=local,dest=${IMAGE_NAME}-${VERSION}-${ARCH} \
--tag ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${VERSION}-${ARCH} \
--tag docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${IMAGE_NAME}:${VERSION}-${ARCH} \
--push \
.
echo "::set-output name=version::${VERSION}"
Expand All @@ -64,12 +77,6 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Login to Quay
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -97,11 +104,8 @@ jobs:
cache="${cache} --cache-from type=local,src=./$IMAGE_NAME-$VERSION-$(echo $arch | sed 's/\//-/g')"
done
quay_user="$(echo ${{ secrets.QUAY_USERNAME }} | cut -f1 -d'+')"
build="docker buildx build ${platforms} \
--tag ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$VERSION \
--tag quay.io/${quay_user}/$IMAGE_NAME:$VERSION \
--tag docker.io/${{ secrets.DOCKERHUB_USERNAME }}/$IMAGE_NAME:$VERSION \
--build-arg BUILD_THREADS=3 \
--label org.opencontainers.image.source=https://github.com/${{ github.repository }} \
Expand Down
81 changes: 58 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,67 @@
###################
# --- builder --- #
###################
FROM docker.io/debian:10-slim AS builder
FROM docker.io/debian:11-slim AS builder

WORKDIR /opt

RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y build-essential \
cmake pkg-config libboost-all-dev \
libssl-dev libzmq3-dev libunbound-dev \
libsodium-dev libunwind8-dev liblzma-dev \
libreadline6-dev libldns-dev libexpat1-dev \
doxygen graphviz libpgm-dev qttools5-dev-tools \
libhidapi-dev libusb-1.0-0-dev libprotobuf-dev \
protobuf-compiler libudev-dev git && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 1

ARG MONERO_VERSION=0.17.3.2
RUN git clone --recursive https://github.com/monero-project/monero.git -b v${MONERO_VERSION} --depth 1

ARG BUILD_THREADS=1
RUN cd monero && \
case "$(uname -m)" in \
x86_64) make -j${BUILD_THREADS} release-static-linux-x86_64;; \
aarch64* | arm64 | armv8*) make -j${BUILD_THREADS} release-static-linux-armv8;; \
armv7*) make -j${BUILD_THREADS} release-static-linux-armv7;; \
armv6*) make -j${BUILD_THREADS} release-static-linux-armv6;; \
*) echo "Unknown architecture: $(uname -m)" && exit 1;; \
apt-get install -y wget git build-essential \
automake autotools-dev bsdmainutils \
ca-certificates curl libtool gperf \
cmake pkg-config libssl-dev libzmq3-dev \
libunbound-dev libsodium-dev libunwind8-dev \
liblzma-dev libreadline6-dev libldns-dev libexpat1-dev \
libpgm-dev qttools5-dev-tools libhidapi-dev \
libusb-1.0-0-dev libprotobuf-dev protobuf-compiler \
libudev-dev libboost-chrono-dev libboost-container-dev \
libboost-date-time-dev libboost-filesystem-dev \
libboost-locale-dev libboost-program-options-dev libboost-regex-dev \
libboost-serialization-dev libboost-system-dev \
libboost-thread-dev python3 ccache doxygen graphviz \
libevent-dev libnorm-dev

ARG MONERO_VERSION=0.18.0.0
RUN git clone --recursive --depth 1 --shallow-submodules https://github.com/monero-project/monero.git -b v${MONERO_VERSION}

ARG BUILD_THREADS
# Build libexpact - required for libunbound
RUN set -ex && wget https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.bz2 && \
echo "a247a7f6bbb21cf2ca81ea4cbb916bfb9717ca523631675f99b3d4a5678dcd16 expat-2.4.8.tar.bz2" | sha256sum -c && \
tar -xf expat-2.4.8.tar.bz2 && \
rm expat-2.4.8.tar.bz2 && \
cd expat-2.4.8 && \
./configure --enable-static --disable-shared --prefix=/usr && \
make -j${BUILD_THREADS:-$(nproc)} && \
make -j${BUILD_THREADS:-$(nproc)} install

# Build libunbound
WORKDIR /tmp
RUN set -ex && wget https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.1.tar.gz && \
echo "2fe4762abccd564a0738d5d502f57ead273e681e92d50d7fba32d11103174e9a unbound-1.16.1.tar.gz" | sha256sum -c && \
tar -xzf unbound-1.16.1.tar.gz && \
rm unbound-1.16.1.tar.gz && \
cd unbound-1.16.1 && \
./configure --disable-shared \
--enable-static \
--without-pyunbound \
--with-libexpat=/usr \
--with-ssl=/usr \
--with-libevent=no \
--without-pythonodule \
--disable-flto \
--with-pthreads \
--with-libunbound-only \
--with-pic && \
make -j${BUILD_THREADS:-$(nproc)} && \
make -j${BUILD_THREADS:-$(nproc)} install

WORKDIR /opt/monero
RUN case "$(uname -m)" in \
x86_64) make -j${BUILD_THREADS:-$(nproc)} release-static-linux-x86_64;; \
aarch64* | arm64 | armv8*) make -j${BUILD_THREADS:-$(nproc)} release-static-linux-armv8;; \
*) echo "Unexpected architecture: $(uname -m)" && exit 1;; \
esac

##################
Expand All @@ -39,7 +73,8 @@ ENV PATH=/opt/monero:${PATH}

RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y tini ca-certificates libkrb5-dev && \
apt-get install -y tini libkrb5-dev \
curl ca-certificates && \
apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt && \
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ docker run \
### Where can I download the image?
I'm using Github Actions to build and publish this image to:
* [ghcr.io/rblaine95/monero](https://ghcr.io/rblaine95/monero)
* [quay.io/rblaine95/monero](https://quay.io/repository/rblaine95/monero)
* [docker.io/rblaine/monero](https://hub.docker.com/r/rblaine/monero)

### Future stuff
Expand Down

0 comments on commit c1c3509

Please sign in to comment.