I need to use the official PowerShell Core Docker image to run a Docker container and make it execute a PowerShell script file.
I know it can be done using a Dockerfile and Docker build, but can't use that in this case.
From reading docs I came up with this, but it does not seem to work:
docker run -it --rm --entrypoint "/tmp/test.ps1" repo/powershell:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"/tmp/test.ps1\": stat /tmp/test.ps1: no such file or directory": unknown.
ERRO[0001] error waiting for container: context canceled
Error seems to say that it can't find the file but when running stat "/tmp/test.ps1"
manually it works fine.
I feel like the binary pwsh
should also be specified but can't find a way how to do it.