I'm trying to run a local script in my docker host on a docker container.
I know it is possible to run it using:
docker exec -i mycontainer bash < mylocal.sh,
but how do I pass arguments to the mylocal.sh using this method.
Say I want to pass the script contents plus an argument like mylocal.sh argument1
I don't really want to copy the files over from host to container.
I don't really want to copy the files over from host to container.is there any real reason behind that ? If you need to execute that file from the container, why don't you just make it available there ? I have absolutely no idea how you can pass arguments to that file in the current context (and I even doubt it is possible). If you copy the script to the container (either in the image at build time or withdocker copy...), then it is as easy asdocker exec -i mycontainer myscript argument1 argument2....