Execute a Shell Script Inside a Docker Container

preview_player
Показать описание
This video demonstrates running complex instructions inside a docker container without permanently adding the script to the container. This makes for easily pluggable maintenance and other tasks with a Docker container instance.
Рекомендации по теме
Комментарии
Автор

I'm getting this error any idea


docker run -it --rm -v $(pwd):/src alpine /src/hello.sh
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/src/hello.sh\": stat /src/hello.sh: no such file or directory": unknown.

LearnProgrammingInMalayalam
Автор

Cool!
But why -it? It isn't necessary, and the container exits after running the script anyway, right?

loncewyse
Автор

Hey

how do i write a shell script for such use case scenario if Docker Container is down than it should get notified by email automatically

dannyroy