Skip to content

Instantly share code, notes, and snippets.

@hakito
Created October 27, 2019 07:20
Show Gist options
  • Save hakito/cceed9425ebb1e361fc6b3e61342317f to your computer and use it in GitHub Desktop.
Save hakito/cceed9425ebb1e361fc6b3e61342317f to your computer and use it in GitHub Desktop.
Windows docker run command forwarder file
@echo off
SET DOCKER_IMAGE_NAME = %1
SHIFT
powershell -Command "& {docker run -it --rm -v '%cd%:/ws' -w /ws %DOCKER_IMAGE_NAME% %*}"
@hakito
Copy link
Author

hakito commented Oct 27, 2019

Example call dr.cmd composer help to execute the composer image from docker hub.

The current directory will be mounted as working directory inside of the container.

You can then simply create a direct forwarder by creating a composer.cmd file with:

@dr composer %*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment