Docker Community Forums

Share and learn in the Docker community.

How run powershell scripts in docker compose


(Balajepalli) #1

I am trying to spin a new container and run a powershell script with in the new container. This is my docker compose file

version: “3”
services:
webapp:
build: .
image: “iis”
command: powershell -executionpolicy bypass “C:\docker\sharedFiles\scripts\generic_script.ps1” #tried with containerpath “C:\sharedFiles\scripts\generic_script.ps1”
ports:
- “80:8000”
networks:
nat:
ipv4_address: 172.20.128.2
volumes:
- “C:/docker/sharedFiles:c:/sharedFiles”
networks:
nat:
external: true

I am able to spin the cotnainer, but the PS script is not getting executed. What am i missing ?