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?

  • Woocommerce webhook debugging on nginx in a docker container
  • Gitlab CI: How to run tests in pipeline using docker and shell runner
  • Dockerfile: Copied file not found
  • docker compose with swarm and spring boot, cannot connect to database on different node
  • How exactly does docker work? (Theory)
  • Link Docker Container across the Host
  • How to create a Dockerfile for cassandra (or any database) that includes a schema?
  • Getting ember to run under docker on Windows Quickstart
  • Right way to use ENTRYPOINT to enable container start and stop
  • After docker build . the container is not displayed, why?
  • How to configure docker to use /opt instead of /var
  • Windows Image on Docker
  • 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.