question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell Core on smaller Linux distributions (eg. Alpine)

See original GitHub issue

I’d like to try to get PowerShell Core working on Alpine Linux, with the long term goal of being able to run lightweight PowerShell Core Docker containers. The Docker container images I built using Ubuntu 16 and CentOS 7 are a bit on the large side.

So far, we know the following:

  • .NET Core is included with the PowerShell Core distributions
  • .NET Core has a dependency on libicu52 and libunwind8

What we need to figure out:

  • How to install or compile libicu52 on Alpine Linux
  • How to install or compile libunwind8 on Alpine Linux
  • How to install or compile PowerShell Core binaries on Alpine Linux

Anyone want to provide some insight to this effort?

Cheers, Trevor Sullivan Docker Captain Microsoft MVP: Cloud & Data Center Management https://trevorsullivan.net https://twitter.com/pcgeek86

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
pcgeek86commented, Aug 26, 2016

So, I talked with the .NET team, and discovered that there’s a microsoft/dotnet:core image that’s only 250 MB. By inspecting the Dockerfile for .NET Core dependencies, I was able to produce a smaller Docker image for PowerShell Core, than what was possible with Ubuntu and CentOS 7. I used the Dockerfile statements from the .NET Core dependencies base image, and extended it to include PowerShell Core from a local build context. That avoided the need to install curl or wget along with extra dependencies.

Now, the Docker image based on Debian Jessie is only 334.3 MB.

https://twitter.com/pcgeek86/status/769239625047035904 https://hub.docker.com/r/trevorsullivan/powershell/

PS C:\Users\TrevorSullivan\PowerShellCore> docker images trevorsullivan/powershell
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
trevorsullivan/powershell   jessie              4abfcbcdfcf8        16 minutes ago      334.3 MB
trevorsullivan/powershell   centos7             6d7da3eb764b        7 days ago          571.5 MB
trevorsullivan/powershell   latest              3cbb7892a31c        8 days ago          537.1 MB

It’s still not as small as we could get with Alpine Linux, but it’s a huge improvement.

1reaction
andyleejordancommented, Oct 12, 2016

@pcgeek86 do our new containers fit your need?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing PowerShell on Alpine Linux
Information about installing PowerShell on Alpine Linux.
Read more >
Creating a Multiplatform Powershell Core App Container
The PowerShell team produces Core images for Windows and Linux. ... I want the smallest possible images, which means using Nano Server ...
Read more >
How to Use Microsoft PowerShell Core on Linux Virtual ...
In this article, I'll install PowerShell Core on the Linux distribution known as Ubuntu. That being the case, I'll need to use a...
Read more >
Install PowerShell on Linux
Learn about the Linux distributions supported by PowerShell. ... Alpine; Debian; Red Hat Enterprise Linux (RHEL); Ubuntu; Raspberry Pi OS ...
Read more >
How to install PowerShell 7 on Linux
How do I install PowerShell on Linux? This guide has instructions using GUI and Terminal commands, including steps to fix dependency issues.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found