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?

  • Import broker definitions into Dockerized RabbitMQ
  • How to list all the docker image layers on a host?
  • JHipster docker compose send to docker hub
  • Docker WSO2 Publisher: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
  • Docker + Virtual Box = VT-x is not available (VERR_VMX_NO_VMX)
  • I can't run rails console with Docker and Passenger/nginx image
  • Docker Swarm Service Can Not Be Reached on Different Node After Period
  • How to remount the proc filesystem in a docker as a r/w system?
  • Mount a Virtualbox shared folder as a volume for Docker running on the guest OS
  • Docker: Linking Spring Boot container with Mongo DB container
  • Docker failover: Redis, MySQL and Nginx
  • Git repo structure with multiple docker files
  • 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

    You can see some examples at


    docker exec -it container_id unzip -d ~/Captvty ~/Téléchargements/

    answer Yes to All


    docker exec -it container_id rm ~/Téléchargements/

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