skip to Main Content

I need to try out some stuff with Powershell on Linux. I have created a docker container with the following command:

docker run -it --name pwsh mcr.microsoft.com/powershell:lts-centos-8

This works as expected and i have an interactive shell i can work with. But i want to reuse it after i have stopped the container.

I have tried the following:

docker start -ia pswh

But this just starts the container and immediately stops it. Any Ideas how i can again enter an interactive session?

2

Answers


  1. Chosen as BEST ANSWER

    While i don't have a solution for my own question i have made a workaround and used the .NET SDK container image which comes with powershell included.


  2. You can start the container by executing the following command in interactive mode:

    docker -it pswh /bin/bash
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search