brentmjohnson commented on issue #19240:
URL: https://github.com/apache/beam/issues/19240#issuecomment-1483528346

   Great and I should also note that there is kind of a hacky workaround to 
intercept and inject additional arguments into the docker run command:
   
   1. Override PATH environment variable to PREpend a path where you will 
create a shell script called `docker`
   2. Create something like the following `docker` at the new path:
   ```
   #!/bin/sh
   
   # Parse the command and arguments
   command=$1
   shift
   args=$*
   
   # Check if the command is "run"
   if [ "$command" = "run" ]; then
     # Set the additional arguments to inject
     additional_args="--device /dev/dxg --mount 
type=bind,src=/usr/lib/wsl,dst=/usr/lib/wsl"
   
     # Invoke the executable with the injected arguments
     /usr/bin/docker $command $additional_args $args
   else
     # Invoke the executable without injected arguments
     /usr/bin/docker $command $args
   fi
   ```
   3. Depending on your beam runner potentially build custom images to include 
the above.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to