Open gnatbandanna opened 9 months ago
Until this is resolved, for anyone else having this issue now, and would like to build a working image with 8.x, try the below. Note I presume the passwd issue is coming from jlesage's image, and I didn't bother changing anything there since it would be annoying for anyone to maintain. I fudged it instead. Cinit was chosen because it's one of the only things that runs as root:
Add/Edit to Dockerfile:
ARG VERSION=8.20
...
COPY fix.cinit /fix.cinit
RUN /fix.cinit
and place fix.cinit where you're doing your docker build
. The fix.cinit
:
#!/bin/sh
echo "===> Fudging cinit <==="
cd /opt/base/sbin/
mv cinit cinit.bin
echo \
"cat <<EOF>/etc/passwd
root::0:0::/root:/sbin/nologin
app::1000:1000::/config/MegaBasterd/jar/:/sbin/nologin
EOF" > cinit
echo '/opt/base/sbin/cinit.bin "$@"' >> cinit
chmod +x cinit
Thank you for the detailed investigation, around holiday season it's hard to find the time for debugging. I will set up the right home variable value for the user app and push out an updated build if it works.
I'll leave a comment here for you to test the new build to ensure it also works as expected on the raspberry platform.
Thank you for the detailed investigation, around holiday season it's hard to find the time for debugging. I will set up the right home variable value for the user app and push out an updated build if it works.
No problem! Note that I did try exporting HOME
in /startapp.sh
and that didn't seem to work, which led me to think that maybe Java uses the passwd
file directly (maybe someone with Java knowledge can correct me), so I just fudged it -- and that worked. You'll probably have a more elegant solution!
Current Behavior
Default (uses MB 7x) pull of
gauravsuman007/megabasterd-docker
and subsequentdocker compose up
works flawlessly, however after upgrading./config/Megabastered/jar/MegaBastered.jar
with the jar fromMegaBasterdLINUX_8.18_portable.zip
, the following error occurs:This works fine when reverting back to v7.7x.
Expected Behavior
I expect what the docs say: To manually upüdate to the latest Megabasterd release, download the latest Linux version of their java package, unzip it and copy the MegaBasterd.jar from the jar folder to /config/MegaBasterd/jar/ (replacing the existing file). Restart the container and the new version should be loaded!
Steps To Reproduce
docker compose up
(works fine, 7x)docker compose down
cp ./MegaBasterdLINUX/jar/MegaBasterd.jar ./config/MegaBasterd/jar/MegaBasterd.jar
(8x)(error follows)
Environment
Container creation
docker compose up
Container log
Container inspect
No response
Anything else?
I have followed the procedure linked with 7.xx and this DID NOT solve the problem for me with 8x. https://github.com/gauravsuman007/megabasterd-docker/issues/2
I also tried upgrading to jdk11 and that DID NOT fix the issue either.
Looking at how MB determines where to write its db, it does use the $HOME var, and is different between MB v8 and v7. I'm not proficient in java, so I'm not certain how these differences affect figuring out the home directory.
v8:
v7
Further, this problem DOES NOT occur with
root
, which does have a home directory defined:If I connect to a running container with
and use the command
I get the error (note mb.jar is v8.20):
However, if I do the same as '-u root', it works fine (expected soft error):
and if I change 'root' home to
/dev/null
, as in the 'app' user, I get precisely the same error as 'app':and if I change 'app' home to
/config/MegaBasterd/jar/
, it works as expected, no error:no error, yay! works: