Closed samsapti closed 2 years ago
Ahhh, maybe fixuid doesn't support ARM on that binary... I'll work on a solution.
I've got a solution in mind, will push shortly.
Pushed a fix in https://github.com/sethforprivacy/simple-monerod-docker/commit/bb0836ffea6b0bce35981d29b121ab8dcd7f88de, please test ASAP once the image is pushed as I don't have an ARM device to test on.
@samsaptidev New image is pushed, please test and report back!
@sethforprivacy Still doesn't work :(
@sethforprivacy Still doesn't work :(
Same error? Are you sure you pulled the latest?
@sethforprivacy Yes, same error, I did pull the latest image.
$ docker-compose down
$ docker-compose pull
$ docker-compose up -d
I do have an idea about what could be wrong though. I'll paste a diff below:
diff --git a/entrypoint.sh b/entrypoint.sh
index 2223794..6163c6e 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,16 +1,16 @@
-#!/bin/ash
+#!/bin/sh
# Credit for the bulk of this entrypoint script goes to cornfeedhobo
# Source is https://github.com/cornfeedhobo/docker-monero/blob/master/entrypoint.sh
set -e
# Set require --non-interactive flag
-set -- monerod --non-interactive "$@"
+set -- "monerod" "--non-interactive" "$@"
# Configure NUMA if present for improved performance
-numa='numactl --interleave=all'
-if $numa true &> /dev/null; then
- set -- $numa "$@"
+if command -v numactl >/dev/null 2>&1; then
+ numa="numactl --interleave=all"
+ set -- "$numa" "$@"
fi
# Start the daemon using fixuid
# to adjust permissions if needed
-exec fixuid -q "$@"
\ No newline at end of file
+exec fixuid -q "$@"
Basically, I've quoted some variables/strings and made the entrypoint.sh
script POSIX compliant.
I do have an idea about what could be wrong though. I'll paste a diff below:
diff --git a/entrypoint.sh b/entrypoint.sh index 2223794..6163c6e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,16 +1,16 @@ -#!/bin/ash +#!/bin/sh # Credit for the bulk of this entrypoint script goes to cornfeedhobo # Source is https://github.com/cornfeedhobo/docker-monero/blob/master/entrypoint.sh set -e # Set require --non-interactive flag -set -- monerod --non-interactive "$@" +set -- "monerod" "--non-interactive" "$@" # Configure NUMA if present for improved performance -numa='numactl --interleave=all' -if $numa true &> /dev/null; then - set -- $numa "$@" +if command -v numactl >/dev/null 2>&1; then + numa="numactl --interleave=all" + set -- "$numa" "$@" fi # Start the daemon using fixuid # to adjust permissions if needed -exec fixuid -q "$@" \ No newline at end of file +exec fixuid -q "$@"
Basically, I've quoted some variables/strings and made the
entrypoint.sh
script POSIX compliant.
Great catch, if that works for you please PR it!
I'm traveling but can approve the PR and let the automatic builds push it.
@sethforprivacy Maybe you could do that? I don't have time to build and push it myself.
@sethforprivacy I've submitted a PR (#64).
@sethforprivacy I've submitted a PR (#64).
Thanks so much! Approved and running a test workflow before pushing a new image with the changes.
New image is building via https://github.com/sethforprivacy/simple-monerod-docker/runs/7529308323?check_suite_focus=true, should push within the next hour if you don't mind testing then.
@samsaptidev new image is live and working properly for me on amd64, please test on arm64 when you get the chance!
I just tried to install with xmr.sh in a RPi and I'm getting this bug (both with latest
and v0.18.0.0
):
root@raspberrypi:/opt/xmr.sh# docker logs monerod
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
root@raspberrypi:/opt/xmr.sh# docker ps | grep monerod
fbfbbfe78312 sethsimmons/simple-monerod:v0.18.0.0 "/entrypoint.sh --pu…" 58 seconds ago Restarting (2) 19 seconds ago monerod
@vdo investigating the cause of this, I'm not sure why this would only happen on the ARM Alpine image at this point. If you have any tips I'm all ears as well!
I found the cause, the binary is not ARM64, but x86-64, probably the arch is not correctly detected in the Dockerfile
. From within the image:
/home/monero # fixuid
/usr/local/bin/fixuid: line 1: syntax error: unterminated quoted string
/home/monero # file /usr/local/bin/fixuid
/usr/local/bin/fixuid: setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=1125EmpZ5ZHTb2ews0ry/INFCnSqDFs1vjNZcIhEh/W8-_OIII-6_sSgui7YlP/uYp1bpCz_s4lay4rDCGl, not stripped
/home/monero # uname -a
Linux 43da0eeaa3d6 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 Linux
This could related with buildx:
Ahh, so even my change didn't pull the right binary... Thanks for digging into it, will keep doing the same and see if I can push a fix.
Idk if it's this simple or not, but I was missing an ARG in the final image build for TARGETARCH:
That may (or may not) fix it, but needed to be added anyways. If you can test with a local image build please do so @vdo.
Ok I'm building it locally with buildx to see if the issue is solved in the emulated container
It seems to be grabbing arm64 binaries properly on the ARM image now: https://github.com/sethforprivacy/simple-monerod-docker/runs/7546320235?check_suite_focus=true#step:11:285
Edit: I also now see on old runs that it was still grabbing amd64 binaries for the ARM build: https://github.com/sethforprivacy/simple-monerod-docker/runs/7529308323?check_suite_focus=true#step:9:529
I think this should be resolved now once it finishes pushing.
Unfortunately there's no way (afaik) to post-build load an image from another arch using buildx... so I will just wait until it finishes to confirm it works on the RPi
@vdo @samsaptidev new image is pushed, please test and report back when you can!
Works now, up and syncing :cocktail:
Awesome! Closing this out, thanks so much for the help finding the root cause here :D
Sorry I'm late to the party. Can confirm it works now, thanks @vdo and @sethforprivacy!
Sorry I'm late to the party. Can confirm it works now, thanks @vdo and @sethforprivacy!
Np, thanks for validating!
After merging #62, my logs look like this:
Adding
user: "${FIXUID:-1000}:${FIXGID:-1000}"
didn't help either. Image tag v0.17.3.2 works as expected.This is on a Raspberry Pi 4B.