PowerShell Core in Debian Docker Container Error

تعرفه تبلیغات در سایت

آرشیو مطالب

امکانات وب

Vote count: 0

I'm new to Docker and am trying to create a Docker image with Raspbian base and PowerShell Core installed.

Here is my Dockerfile:

# Download the latest RPi3 Debian image
FROM resin/raspberrypi3-debian:latest

# Update the image and install prerequisites
RUN apt-get update && apt-get  install -y 
    && apt-get clean

# Grab the latest tar.gz
RUN wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc.2/powershell-6.0.0-rc.2-linux-arm32.tar.gz

# Make folder to put PowerShell
RUN mkdir ~/powershell

# Unpack the tar.gz file
RUN tar -xvf ./powershell-6.0.0-rc.2-linux-arm32.tar.gz -C ~/powershell

# Run PowerShell
CMD ~/powershell/pwsh

However, when I run my image, I get the following error:

hostname: you must be root to change the host name

Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.Tracing.PSEtwLog' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Management.Automation.Tracing.PSSysLogProvider' threw an exception. --->  System.DllNotFoundException: Unable to load DLL 'libpsl-native': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)
   at System.Management.Automation.Tracing.NativeMethods.OpenLog(IntPtr ident, SysLogPriority facility)
   at System.Management.Automation.Tracing.SysLogProvider..ctor(String applicationId, PSLevel level, PSKeyword keywords, PSChannel channels) in /PowerShell/src/System.Management.Automation/utils/tracing/SysLogProvider.cs:line 101
   at System.Management.Automation.Tracing.PSSysLogProvider..cctor() in /PowerShell/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs:line 27
   --- End of inner exception stack trace ---
   at System.Management.Automation.Tracing.PSSysLogProvider..ctor()
   at System.Management.Automation.Tracing.PSEtwLog..cctor() in /PowerShell/src/System.Management.Automation/utils/tracing/PSEtwLog.cs:line 27
   --- End of inner exception stack trace ---
   at System.Management.Automation.Tracing.PSEtwLog.LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, Object[] args) in /PowerShell/src/System.Management.Automation/utils/tracing/PSEtwLog.cs:line 134
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs:line 45
   at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args) in /PowerShell/src/powershell/Program.cs:line 23

It appears that I am not the root user when I load the image and also that a DLL file libpsl-native, or one of its dependencies is not available.

How do I resolve these errors?

Thanks in advance!

asked 56 secs ago

نویسنده : استخدام کار بازدید : 0 تاريخ : يکشنبه 12 فروردين 1397 ساعت: 21:35
برچسب‌ها :



نام کاربري :
رمز عبور :