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 authored Jul 23, 2022
1 parent 3749832 commit 878f452
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 71 deletions.
87 changes: 39 additions & 48 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: linux/amd64,linux/arm64/v8,linux/arm/v7

jobs:
build:
Expand All @@ -13,20 +13,27 @@ jobs:
strategy:
matrix:
include:
- platform: amd64
- platform: arm64/v8
- platform: arm/v7
- arch: amd64
- arch: arm64/v8
- arch: 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: Build Builder
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build
id: build
run: |
# Get the arch for this build
ARCH=$(echo "${{ matrix.platform }}" | sed 's/\//-/g')
ARCH=$(echo "${{ matrix.arch }}" | sed 's/\//-/g')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
Expand All @@ -38,50 +45,34 @@ jobs:
[ "$VERSION" == "master" ] && VERSION=latest
docker buildx build \
--platform linux/${{ matrix.platform }} \
--platform linux/${{ matrix.arch }} \
--build-arg BUILD_THREADS=3 \
--cache-to type=local,dest=${IMAGE_NAME}-${VERSION}-${ARCH} \
--cache-to type=registry,ref=ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${VERSION}-${ARCH}-cache \
--cache-to type=gha,mode=max \
--cache-from type=gha \
--cache-from type=registry,ref=ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${VERSION}-${ARCH}-cache \
--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}"
echo "::set-output name=arch::${ARCH}"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.IMAGE_NAME }}-${{ steps.build.outputs.version }}-${{ steps.build.outputs.arch }}
path: ${{ env.IMAGE_NAME }}-${{ steps.build.outputs.version }}-${{ steps.build.outputs.arch }}
if-no-files-found: error
retention-days: 1
package:
name: Package
needs: [ build ]
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Github
uses: docker/login-action@v2
- uses: docker/login-action@v2
with:
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
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Install Buildx
uses: docker/setup-buildx-action@v2
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Package and push Runner
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Package
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
Expand All @@ -92,20 +83,20 @@ jobs:
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
for arch in $PLATFORMS; do
platforms="${platforms} --platform linux/${arch}"
cache="${cache} --cache-from type=local,src=./$IMAGE_NAME-$VERSION-$(echo $arch | sed 's/\//-/g')"
for platform in $(printf ${PLATFORMS} | sed 's/,/ /g'); do
arch=$(printf $platform | awk -F'/' '{print $2 "-" $3}' | sed -e 's/-$//g')
cacheRegistry="$cacheRegistry --cache-from type=registry,ref=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$VERSION-${arch}-cache"
done
quay_user="$(echo ${{ secrets.QUAY_USERNAME }} | cut -f1 -d'+')"
build="docker buildx build ${platforms} \
build="docker buildx build --platform ${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 }} \
$cache --push ."
--cache-to type=gha,mode=max \
--cache-from type=gha \
$cacheRegistry \
--push ."
echo "$build"
$build
80 changes: 58 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,62 @@ 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;; \
armv7*) make -j${BUILD_THREADS:-$(nproc)} release-static-linux-armv7;; \
*) echo "Unexpected architecture: $(uname -m)" && exit 1;; \
esac

##################
Expand All @@ -39,7 +74,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 878f452

Please sign in to comment.