Closed JST5000 closed 1 year ago
@JST5000 @justinr1234 Makes perfect sense, happy to merge this. But thinking ahead: wouldn't it make more sense to pass en entire "rippled env" string to the args? To make it universal for any arg to be passed, now and in the future?
@JST5000 @justinr1234 Makes perfect sense, happy to merge this. But thinking ahead: wouldn't it make more sense to pass en entire "rippled env" string to the args? To make it universal for any arg to be passed, now and in the future?
Yeah makes the most sense. Great idea! 🙏🏻
Update coming in, both environment variables & arguments are passed now, and confirmed during boot;
docker run \
-e test123=345 \
-it --name xrpld -p $PORT:80 \
-v $(pwd)/../config:/config/ \
xrpllabsofficial/xrpld:latest \
-aaa=bbb \
-c=ddd
echo "Args:"
echo " >> [$@]"
echo ""
echo "Env:"
printenv
echo ""
Args:
>> [-aaa=bbb -c=ddd]
Env:
HOSTNAME=049e5569c379
PWD=/
HOME=/root
test123=345
TERM=xterm
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/printenv
Fixed, pushed, published @ Docker Hub.
Fixed, pushed, published @ Docker Hub.
Absolute legend 👏👌🙌
Just to chime in, I handled it like this... Where you set the target. But it seems like most want the ability to send in any env/arg so this might not work as well.
FROM base AS production
RUN echo "PRODUCTION RIPPLED"
ENTRYPOINT [ "/entrypoint.sh" ]
FROM base AS standalone
RUN echo "STANDALONE RIPPLED"
ENTRYPOINT [ "/entrypoint.sh", "--start", "-a" ]
@JST5000 @dangell7 @justinr1234
New version published to Docker Hub, it allows for all three methods:
ENV_ARGS
environment variableSo this now works:
docker run -it --rm -p $PORT:80 -e "ENV_ARGS=--start -a" -v $(pwd)/config:/config/ xrpllabsofficial/xrpld:latest
While unlikely to be used this way, even passing a combination of ENV_ARGS
and cli passed args work.
@JST5000 @dangell7 @justinr1234
New version published to Docker Hub, it allows for all three methods:
- Env. var passthrough
- Argument passthrough
- Arguments passed through the
ENV_ARGS
environment variableSo this now works:
docker run -it --rm -p $PORT:80 -e "ENV_ARGS=--start -a" -v $(pwd)/config:/config/ xrpllabsofficial/xrpld:latest
While unlikely to be used this way, even passing a combination of
ENV_ARGS
and cli passed args work.
Thanks! This should help us speed up our testing a lot :)
@WietseWind I think the new version of this code may not have been deployed to Docker Hub. (Maybe the old version was re-deployed by accident?)
When I run the command you shared, the entrypoint.sh
still looks like the old entrypoint (so ENV_ARGS
doesn't work)
Exact command I ran for reference: docker run -it --rm -p $PORT:80 -e "ENV_ARGS=--start -a" -v $(pwd)/config:/config/ xrpllabsofficial/xrpld:latest
Screenshot of cat entrypoint.sh
inside the docker container along with the name of the container.
(Relatedly, I made a PR to update the README instructions where they were off by a little bit, but even after that I'm still seeing the above behavior: https://github.com/WietseWind/docker-rippled/pull/17)
It has been deployed, did you clean the local Docker image cache? Read: did you remove the local image before re-creating the container?
Ah, yep. docker rmi ...
fixed it - sorry about that :) (I thought that removing the containers was the same as removing the image)
I'd like to use this as part of xrpl.js and xrpl-py's integration tests, but currently am unable to because we need to start the container in standalone mode and GitHub actions'
services
feature doesn't support passing in args to a container directly.Previously we forked this repo, but that led to the problem of falling out of date with the latest rippled changes. (This is the setup on xrpl.js for reference)
So, since GitHub actions allows flags to be passed in, my proposed fix is to add an option to pass in the environment variable
STANDALONE_MODE
which starts the container in standalone mode.(I'm open to other better ways to go about this. This seemed like the simplest change to me.)