Skip to content

Commit

Permalink
bump to v0.18.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cornfeedhobo committed Mar 16, 2024
1 parent 16fb1c5 commit e8da1f4
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 203 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
23 changes: 11 additions & 12 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ jobs:
steps:

- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Collect build context
id: context
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d')"
echo "::set-output name=version::$(cat VERSION)"
echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
echo "version=$(< VERSION)" >> "$GITHUB_OUTPUT"
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -45,26 +45,25 @@ jobs:

- name: Docker metadata mapping
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ github.repository_owner }}/monero
ghcr.io/${{ github.repository_owner }}/monero
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BUILD_DATE=${{ steps.context.outputs.date }}
MONERO_VERSION=${{ steps.context.outputs.version }}
MONERO_HASH=${{ fromJson(steps.get_release_ref.outputs.data).object.sha }}
MONERO_TARGET=release
MONERO_TAG=${{ steps.context.outputs.version }}
MONERO_SHA=${{ fromJson(steps.get_release_ref.outputs.data).object.sha }}
19 changes: 13 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# Contributing

## Building locally

```shell
BUILD_TAG='my-monero-build' ./build.sh
```

## Publishing a new release

1) Update the `VERSION` file to match the release version to be built

1) Build

```shell
BUILD_TAG="$(< VERSION)-local" \
BUILD_DATE="$(date +'%Y-%m-%d')" \
./build.sh
```

1) Test

```shell
UID="$(id -u)" GID="$(id -g)" \
WALLET='do_not_use_test_wallet' \
TAG="$(< VERSION)-local" \
docker compose run wallet
```

1) Checkout a new branch and commit

```shell
Expand Down
232 changes: 69 additions & 163 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,183 +1,93 @@
# Multistage docker build, requires docker 17.05

# Builder stage
FROM alpine:3.15 as builder
FROM alpine:edge as builder

ARG MONERO_VERSION
ARG MONERO_HASH
ARG MONERO_TARGET
ARG MONERO_TAG
ARG MONERO_SHA

# Make sure we got the inputs we expect
RUN set -ex && \
test -n "${MONERO_HASH}" && \
test -n "${MONERO_TARGET}" && \
test -n "${MONERO_VERSION}"
test -n "${MONERO_TAG}" && \
test -n "${MONERO_SHA}"

# These steps are broken up so that the builder picks up the layer from the --update command
RUN set -ex && apk --update --no-cache upgrade
RUN set -ex && apk add --no-cache \
RUN set -ex && \
apk update && \
apk upgrade --no-cache && \
apk add --no-cache \
autoconf \
automake \
boost \
boost-atomic \
boost-build \
boost-build-doc \
boost-chrono \
boost-container \
boost-context \
boost-contract \
boost-coroutine \
boost-date_time \
boost-dev \
boost-doc \
boost-fiber \
boost-filesystem \
boost-graph \
boost-iostreams \
boost-libs \
boost-locale \
boost-log \
boost-log_setup \
boost-math \
boost-prg_exec_monitor \
boost-program_options \
boost-python3 \
boost-random \
boost-regex \
boost-serialization \
boost-stacktrace_basic \
boost-stacktrace_noop \
boost-static \
boost-system \
boost-thread \
boost-timer \
boost-type_erasure \
boost-unit_test_framework \
boost-wave \
boost-wserialization \
ca-certificates \
cmake \
curl \
dev86 \
doxygen \
eudev-dev \
file \
g++ \
gettext \
git \
go \
graphviz \
libexecinfo-dev \
libsodium-dev \
gperf \
libtool \
libusb-dev \
linux-headers \
make \
miniupnpc-dev \
ncurses-dev \
openssl-dev \
pcsc-lite-dev \
pkgconf \
protobuf-dev \
rapidjson-dev \
readline-dev \
unbound-dev \
zeromq-dev

WORKDIR /usr/src

ENV CFLAGS="-fPIC"
ENV CXXFLAGS="-fPIC -DELPP_FEATURE_CRASH_LOG"

# Build Monero
RUN set -ex \
&& git clone --recursive --depth 1 -b ${MONERO_VERSION} https://github.com/monero-project/monero.git \
&& cd monero \
&& git submodule init \
&& git submodule update \
&& nice -n 19 ionice -c2 -n7 make -j${NPROC:-$(nproc)} ${MONERO_TARGET}

# Install fixuid tool
patch \
perl \
python3 \
zlib-dev

# Alpine doesn't package this anymore, and it's been archived on github.
# This is dirty and won't last forever. It might be worth embedding soon.
RUN apk add --no-cache \
--repository=http://dl-cdn.alpinelinux.org/alpine/v3.16/main \
libexecinfo-dev

# Build the fixuid tool
RUN set -ex && \
go install github.com/boxboat/fixuid@v0.5.1 && \
chmod 4755 /root/go/bin/fixuid

# Clone Monero and submodules
RUN git clone \
--recursive --depth 1 -b ${MONERO_TAG} \
https://github.com/monero-project/monero.git \
/usr/src/monero

WORKDIR /usr/src/monero

# This is patched on master, but didn't make it into this release.
COPY epee.stdint.patch epee.stdint.patch
RUN patch -p1 < epee.stdint.patch

# Set flags that make it possible to compile against musl.
ENV CFLAGS="-fPIC -DELPP_FEATURE_CRASH_LOG -DSTACK_TRACE=OFF"
ENV CXXFLAGS="-fPIC -DELPP_FEATURE_CRASH_LOG -DSTACK_TRACE=OFF"
ENV LDFLAGS="-Wl,-V"

# Build dependencies and monero, but like, be nice about it.
RUN nice -n 19 \
ionice -c2 -n7 \
make -j${NPROC:-$(( $(nproc) - 1 ))} depends target=x86_64-linux-gnu


# Runtime stage
FROM alpine:3.15
FROM alpine:edge as runtime

ARG MONERO_VERSION
ARG MONERO_HASH
ARG MONERO_TARGET
ARG MONERO_TAG
ARG MONERO_SHA

RUN set -ex && apk --update --no-cache upgrade
RUN set -ex && \
case "${MONERO_TARGET}" in \
*static*) apk add --no-cache \
ca-certificates \
iputils \
libexecinfo \
libsodium \
ncurses-libs \
pcsc-lite-libs \
readline \
zeromq \
;; \
*) apk add --no-cache \
boost \
boost-atomic \
boost-chrono \
boost-container \
boost-context \
boost-contract \
boost-coroutine \
boost-date_time \
boost-fiber \
boost-filesystem \
boost-graph \
boost-iostreams \
boost-libs \
boost-locale \
boost-log \
boost-log_setup \
boost-math \
boost-prg_exec_monitor \
boost-program_options \
boost-python3 \
boost-random \
boost-regex \
boost-serialization \
boost-stacktrace_basic \
boost-stacktrace_noop \
boost-static \
boost-system \
boost-thread \
boost-timer \
boost-type_erasure \
boost-unit_test_framework \
boost-wave \
boost-wserialization \
ca-certificates \
iputils \
libexecinfo \
libsodium \
libusb \
miniupnpc \
ncurses-libs \
numactl-tools \
openssl \
pcsc-lite-libs \
protobuf \
rapidjson \
readline \
unbound-libs \
zeromq \
;; \
esac
apk update && \
apk upgrade --no-cache && \
apk add --no-cache \
ca-certificates

COPY --from=builder /root/go/bin/fixuid /usr/local/bin/fixuid
COPY --from=builder /usr/src/monero/build/Linux/_no_branch_/release/bin/* /usr/local/bin/
# Alpine doesn't package this anymore, and it's been archived on github.
# This is dirty and won't last forever. It might be worth embedding soon.
RUN apk add --no-cache \
--repository=http://dl-cdn.alpinelinux.org/alpine/v3.16/main \
libexecinfo

ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
COPY --from=builder /root/go/bin/fixuid /usr/local/bin/fixuid
COPY --from=builder /usr/src/monero/build/x86_64-linux-gnu/release/bin/* /usr/local/bin/

# Create a dedicated user and configure fixuid
ARG MONERO_USER="monero"
Expand All @@ -188,11 +98,13 @@ RUN set -ex && \
printf "user: ${MONERO_USER}\ngroup: ${MONERO_USER}\n" > /etc/fixuid/config.yml
USER "${MONERO_USER}:${MONERO_USER}"

# Contains the blockchain and wallet files
# Define a volume for the blockchain and wallet files
ARG MONERO_HOME="/home/${MONERO_USER}/.bitmonero"
VOLUME ${MONERO_HOME}
WORKDIR ${MONERO_HOME}

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "monerod", \
"--p2p-bind-ip=0.0.0.0", \
"--p2p-bind-port=18080", \
Expand All @@ -203,16 +115,10 @@ CMD [ "monerod", \

EXPOSE 18080 18081

# Labels, for details see http://label-schema.org/rc1/
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
ARG BUILD_DATE
LABEL maintainer="github.com/cornfeedhobo/docker-monero"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.build-date="${BUILD_DATE}"
LABEL org.label-schema.name="cornfeedhobo/monero"
LABEL org.label-schema.description="Built from source monero Docker images based on Alpine Linux"
LABEL org.label-schema.url="https://getmonero.org/"
LABEL org.label-schema.vcs-url="https://github.com/monero-project/monero/"
LABEL org.label-schema.vcs-ref="${MONERO_HASH}"
LABEL org.label-schema.vendor="cornfeedhobo"
LABEL org.label-schema.version="${MONERO_VERSION}"
LABEL org.label-schema.docker.cmd="docker run -dit -p 18080:18080 -p 18081:18081 cornfeedhobo/monero"
LABEL org.opencontainers.image.authors cornfeedhobo
LABEL org.opencontainers.image.created ${BUILD_DATE}
LABEL org.opencontainers.image.revision ${MONERO_SHA}
LABEL org.opencontainers.image.source https://github.com/cornfeedhobo/docker-monero
LABEL org.opencontainers.image.version ${MONERO_TAG}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.18.3.1
v0.18.3.2
Loading

0 comments on commit e8da1f4

Please sign in to comment.