Invoking via Docker

If you want to run docker explicitly you can, of course, do that as well. The basic way to run the container is this one:

    PWD=your-project-folder
    docker run -it --rm \
              --volume ${PWD}:/workspace \
              --env METERIAN_API_TOKEN=your-token-here \
              meterian/cli [Meterian CLI Options]

Please note that in this situation the local caches used by the tools will not be bound. We suggest you bind those folders, and the easiest way to do that is to use the provided meterian-docker script.

However, if you feel adventurous, you can of course do it yourself. For example, to bind the java caches in a maven build:

    PWD=your-project-folder
    docker run -it --rm \
              --volume ${PWD}:/workspace \
              --env METERIAN_API_TOKEN=your-token-here \
              --mount type=bind,source=${HOME}/.m2,target=/home/meterian/.m2 \
              meterian/cli [Meterian CLI Options]

In some cases (i.e dotnet) you will need to specify the UID and the GID in order for the system to work, reaching something like this:

    PWD=your-project-folder
    HOST_UID=`id -u`
    HOST_GID=`id -g`
    docker run -it --rm \
              --volume ${PWD}:/workspace \
              --env METERIAN_API_TOKEN=your-token-here \
              --mount type=bind,source=${HOME}/.dotnet,target=/home/meterian/.dotnet \
              --mount type=bind,source=${HOME}/.nuget,target=/home/meterian/.nuget \
              --env HOST_UID=${HOST_UID} \
              --env HOST_UID=${HOST_GID} \
              meterian/cli [Meterian CLI Options]

The script is run by the meterian user in the container, with their home at /home/meterian. You can see how this works in the source of the meterian-docker script. Please get in touch if you have any issue using the support channels.

Last updated