cannot get bash prompt: Error response from daemon: Container foo is not running
Whoever created basex/basexhttp:latest does not seem to know Docker very well. They copied files necessary to a directory that was later configured as a volume, which means it can only be bound to an anonymous volume, otherwise files inside will be removed. They left source code inside the image, they used a single stage build with maven:3-jdk-8-alpine as base image, which means the final image has many unnecesary things installed. They left the entrypoint from the base image intact, which I guess is why they needed to create an empty /srv/.m2 directory and set it as Maven config dir for the image to start. It switches user from root to basex, which causes permission problems with bind mounts. Generally it's a mess.
I see two ways to successfully run this image:
First:
docker run -d \
    --name basexhttp \
    --publish 1984:1984 \
    --publish 8984:8984 \
    --entrypoint &quot;&quot; \
    basex/basexhttp:latest /usr/local/bin/basexhttp 

This uses only anonymous volumes and clears that unnecessary entrypoint.
You can stop it with docker stop basexhttp and then remove it with docker rm -v basexhttp. That -v is important - it removes the volumes - unless you memorize their very long IDs and which was mounted which you won't be able to reuse them anyway, so you may as well remove them from your system.
Second:
mkdir -p $HOME/basex/data
mkdir -p $HOME/basex/repo
mkdir -p $HOME/basex/webapp
chmod a+w basex
sudo chown -R 1984:1984 $HOME/basex
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 \
    --entrypoint &quot;&quot; \
    basex/basexhttp:latest bash -c &quot;cp -r /usr/src/basex/basex-api/src/main/webapp/WEB-INF /srv/basex/webapp &amp;&amp; exec /usr/local/bin/basexhttp&quot;

This creates the necessary directories and sets their permissions so that both your user on the host and user.
You can stop it as in the previous example and remove with docker rm basexhttp. This time -v is not necessary, as there are no anonymous volumes.
You can verify that the contaienr is running correctly by executing:
docker exec -ti basexhttp basexclient

Username and password are both admin.