Using Gurobi Optimizer with Docker requires two separate components.
First, you must designate a computer that will run the Gurobi token server (grb_ts). The Gurobi token server, which manages the Gurobi license, must be installed outside of the Docker container. This must be on a machine that your container has a network connection to; this can be a physical computer (e.g., the machine hosting the Docker container), a virtual machine, or a cloud machine. For instructions on setting up the token server, see here.
Second, the Docker containers require Gurobi Optimizer and a client license file. You create the client license file yourself following the instructions here.
The optimization workers can then perform the optimization inside the Docker container. However, you will need to ensure that the worker placement in the cluster is appropriate so that powerful hardware is reserved for those containers in order to prevent performance degradation.