how to start a docker container which dies immediately after startup? On the understanding, from #docker on IRC, that the basex container from docker hub died after starting up, how do I now make it run something which doesn't immediately exit?
I'm only trying to get a bash prompt at this point:
docker run -ti     --link basexhttp:basexhttp     basex/basexhttp:latest basexclient -nbasexhttp

results in:
docker: Error response from daemon: Cannot link to a non running container: /basexhttp AS /charming_villani/basexhttp.

per the basex official doc's.
In trying to add docker logs I've tried:
sudo journalctl -fu docker.service

but will have to look into that a bit as there was no output.

trying a network as suggested:
root $ 
root $ docker network create -d bridge basexhttpnetwork
74c94db9195cf2b671123d016a9082f4aeacbbcef6ed91e4252744afba45d529
root $ 
root $ docker run -ti --name basexhttp --network=basexhttpnetwork basex/basexhttp:latest basexclient -nbasexhttp
docker: Error response from daemon: Conflict. The container name &quot;/basexhttp&quot; is already in use by container &quot;2473f440e93855f967482aed405c30796a779d3592bd66a00fe48c2131b43a5e&quot;. You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
root $
The proper way to run this image, according to the README, is:
docker run -d \
    --name basexhttp \
    --publish 1984:1984 \
    --publish 8984:8984 \
    --volume &quot;$HOME/basex/data&quot;:/srv/basex/data \
    --volume &quot;$HOME/basex/repo&quot;:/srv/basex/repo \
    --volume &quot;$HOME/basex/webapp&quot;:/srv/basex/webapp \
    basex/basexhttp:latest

No weird linking to itself is necessary.
If you wan to run a shell in an already running container (started as above) use:
docker exec -it basexhttp sh

or you can try bash
docker exec -it basexhttp bash

but the container is Alpine-based, so bash might not be installed.
If you want to run a new container and execute shell inside run
docker run -it --rm basexhttp sh 
# or bash if it's installed
docker run -it --rm basexhttp bash

The above will remove the container once you exit bash (but the 3 volumes it creates
will remain, you need to find and remove those by yourself).
Edit:
It seems README is wrong about how to start the container. See my answer to this question for more details.