Docker Community Forums

Share and learn in the Docker community.

Not able to run .sh file from windows docker container. bash is present but not taking any effect

docker

(Jayeshkulkarni) #1

I have built image on top of microsoft/windowsservercore using dockerfile. Docker image is created successfully. I need to run .sh file after logging into windows container. However i am not able to run any .sh file. If i run .sh file, nothing happens.

c:\WorkSpace\dbscripts>bash init_db.sh

c:\WorkSpace\dbscripts>

bash is present on container as Git is installed.

c:\WorkSpace\dbscripts>where bash
c:\git\bin\bash.exe

Is there any way by which i can run .sh files inside windows container ?

C:\Users\Jayesh>docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:12:48 2018
OS/Arch: windows/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.24)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:21:42 2018
OS/Arch: windows/amd64
Experimental: true