Run script from host machine on Docker container with exec [closed]

I do have docker container running and I do quite complex script to run inside container.
The script is located on host machine.
I can’t modify Dockerfile
How can I place script file to docker vm to run it with docker exec?

  • Docker hanging requiring reboot
  • Docker VOLUME for different users
  • AWS ECS Error when running task: No Container Instances were found in your cluster
  • is it possible to ssh into docker container which is not running ( or exited )?
  • How to remove multiple docker images with the same imageID?
  • kubernetes replication controller
  • ecs-cli compose service up doesn't terminate
  • Running and debugging tests in a Docker container
  • Missing PID for process inside docker container
  • Different file owner inside Docker container and in host machine
  • Previously working docker now having errors
  • Getting All Docker Container's IP Address along with Container ID's and Name's
  • One Solution collect form web for “Run script from host machine on Docker container with exec [closed]”

    you can docker cp your script, and then you run it, with something like docker exec -it container_id script

    the doc

    https://docs.docker.com/engine/reference/commandline/cp/

    You can see some examples at
    https://hub.docker.com/r/k3ck3c/captvty/

    extract

    docker exec -it container_id unzip -d ~/Captvty ~/Téléchargements/captvty-2.3.10.zip

    answer Yes to All

    and

    docker exec -it container_id rm ~/Téléchargements/captvty-2.3.10.zip

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.