how to start a docker container which dies immediately after startup?
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.