Friday, August 8, 2025

How to install dockerized powershell on Ubuntu 25.04?

I’m running Ubuntu 25.04 Desktop on ARM64 CPU and I want to run certain software in Docker containers. One of them is Microsoft PowerShell, as various vendors (such as VMware, Veeam, and others) provide PowerShell modules and cmdlets for managing their technologies.

Installation procedure how to enable Docker

# Install Docker 

sudo apt install docker.io

# Install Docker Compose 

sudo apt install docker-compose 

# Add user to docker group to allow particular user to use docker

sudo usermod -aG docker dpasek
newgrp docker 

# Start and enable docker service

sudo systemctl start docker 
sudo systemctl enable docker

Installation procedure how to enable PowerShell

# Get the PowerShell image

docker pull mcr.microsoft.com/powershell:mariner-2.0-arm64

# Create directory for keep PoweShell scripts stored on docker host

mkdir /home/dpasek/scripts 

# Run PowerShell in interactive mode

docker run -it -v /home/dpasek/scripts:/root/scripts mcr.microsoft.com/powershell:mariner-2.0-arm64

Create PowerShell wrapper

cd /home/dpasek 
echo "docker run -it -v /home/dpasek/scripts:/scripts mcr.microsoft.com/powershell:mariner-2.0-arm64" > pwsh.sh
 

Run PowerShell wrapper

 cd
./pwsh.sh 


No comments:

Post a Comment

How to install dockerized powershell on Ubuntu 25.04?

I’m running Ubuntu 25.04 Desktop on ARM64 CPU and I want to run certain software in Docker containers. One of them is Microsoft PowerShell, ...