Render documentation via a docker run


I just migrated to node 10, and aglio does not support this version of node. I try to render my documentation using docker image humangeo/aglio.
Unfortunetaly, it seems that there is an something I don’t understand with mounting volumes on circleci.

Locally my script works fine, but on circleci, it fails.

      - setup_remote_docker:
          docker_layer_caching: true
      - run:
          name: Install Docker client
          command: |
            set -x
            curl -L -o /tmp/docker-$VER.tgz$VER.tgz
            tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            mv /tmp/docker/* /usr/bin
      - run:
          name: Build
          command: npm run nps build

and the shell scripts that is called look like this:

 echo "pwd => $(pwd)"
 echo "ls $(pwd)/documentation-api/ =>"
 ls "$(pwd)"/documentation-api
 docker run -ti --rm -v $(pwd):/docs humangeo/aglio /usr/local/bin/aglio -i /docs/documentation-api/doc.apib -o /docs/index.html

the output is the following:

 pwd => /home/circleci/pft-dialogs

ls /home/circleci/pft-dialogs/documentation-api/ =>
data-structures.apib  doc.apib	overview.apib  pusher  routes

^@^@>> { [Error: Error reading input: ENOENT, open '/docs/documentation-api/doc.apib']
  errno: -2,
  code: 'ENOENT',
  path: '/docs/documentation-api/doc.apib' }

If i run the command locally, it works fine. There seems to be a subtility with mounting docker volumes that I did not get.

I tried running an ls command with busybox and i can’t see my mounted volume:

docker run -ti --rm -v $(pwd):/docs busybox ls

bin   dev   docs  etc   home  proc  root  sys   tmp   usr   var

Can anyone help me ?

Unfortunately, on-host Docker volumes do not work on CircleCI - this is because the containers run on different hosts, and the build server is not reachable (or volumes don’t work over the LAN, I can’t remember which).

Can you work around this limitation? docker cp works just fine, so you can copy things from your project into a running container.

thanks a lot, I will try this?