Correct way to add dotnet-packaging to the Docker microsoft-dotnet-sdk image #118

Open
opened 2026-01-29 16:29:56 +00:00 by claunia · 1 comment
Owner

Originally created by @stdedos on GitHub (Apr 4, 2022).

I am using the https://hub.docker.com/_/microsoft-dotnet-sdk image and I am trying to orchestrate a build process for it.

Following the instructions in https://stackoverflow.com/a/47209000/2309247 didn't help: no "automagic" deb file was created

root@c1bbe48cf612:/source# find / -name '*.deb'
root@c1bbe48cf612:/source#

Using the instructions from the https://github.com/quamotion/dotnet-packaging#readme didn't help either

root@c1bbe48cf612:/source# dotnet deb install
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-deb does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
root@c1bbe48cf612:/source# dotnet tool install --global dotnet-rpm
Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:/root/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:/root/.dotnet/tools"

You can invoke the tool using the following command: dotnet-rpm
Tool 'dotnet-rpm' (version '0.1.220') was successfully installed.
root@c1bbe48cf612:/source# dotnet tool install --global dotnet-deb
Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:/root/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:/root/.dotnet/tools"

You can invoke the tool using the following command: dotnet-deb
Tool 'dotnet-deb' (version '0.1.220') was successfully installed.
root@c1bbe48cf612:/source# dotnet rpm install
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-rpm does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
root@c1bbe48cf612:/source# dotnet deb install
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-deb does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
root@c1bbe48cf612:/source# cat << \EOF >> ~/.bash_profile
> # Add .NET Core SDK tools
> export PATH="$PATH:/root/.dotnet/tools"
> EOF
root@c1bbe48cf612:/source# dotnet deb install
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-deb does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
root@c1bbe48cf612:/source# dotnet-deb
bash: dotnet-deb: command not found
root@c1bbe48cf612:/source# dotnet^C  
root@c1bbe48cf612:/source# export PATH="$PATH:/root/.dotnet/tools"
root@c1bbe48cf612:/source# dotnet deb install
dotnet deb (0.1.220+3f7bd3c61a)
Successfully installed dotnet deb. Now run 'dotnet deb' to package your
application as a Debian/Ubuntu installer package
root@c1bbe48cf612:/source# dotnet rpm install
dotnet rpm (0.1.220+3f7bd3c61a)
Successfully installed dotnet rpm. Now run 'dotnet rpm' to package your
application as a RPM package
root@c1bbe48cf612:/source# dotnet rpm 
dotnet rpm (0.1.220+3f7bd3c61a)
Failed to find a .*proj file in '/source'. dotnet rpm only works if
you have exactly one .*proj file in your directory. For advanced scenarios, please use 'dotnet msbuild /t:CreateRpm'
root@c1bbe48cf612:/source# dotnet publish -c release -o /app --no-restore --runtime linux-x64 --self-contained /t:CreateRpm /t:CreateDeb
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Pinta.Resources -> /source/Pinta.Resources/bin/Release/net6.0/linux-x64/Pinta.Resources.dll
  Pinta.Core -> /source/Pinta.Core/bin/Release/net6.0/linux-x64/Pinta.Core.dll
  Pinta.Tools -> /source/Pinta.Tools/bin/Release/net6.0/linux-x64/Pinta.Tools.dll
  Pinta.Tools -> /app/
  Pinta.Gui.Widgets -> /source/Pinta.Gui.Widgets/bin/Release/net6.0/linux-x64/Pinta.Gui.Widgets.dll
  Pinta.Effects -> /source/Pinta.Effects/bin/Release/net6.0/linux-x64/Pinta.Effects.dll
  Pinta.Effects -> /app/
  Pinta.Docking -> /source/Pinta.Docking/bin/Release/net6.0/linux-x64/Pinta.Docking.dll
  Pinta -> /source/bin/linux-x64/Pinta.dll
  Pinta -> /app/
  Pinta.Docking -> /app/
  Pinta.Resources -> /app/
  Pinta.Core -> /app/
  Pinta.Gui.Widgets -> /app/
/source/Pinta.Effects/Pinta.Effects.csproj : error MSB4057: The target "CreateRpm" does not exist in the project.
/source/Pinta.Tools/Pinta.Tools.csproj : error MSB4057: The target "CreateRpm" does not exist in the project.
root@c1bbe48cf612:/source# dotnet publish -c release -o /app --no-restore --runtime linux-x64 --self-contained /t:CreateDeb
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Pinta.Resources -> /source/Pinta.Resources/bin/Release/net6.0/linux-x64/Pinta.Resources.dll
  Pinta.Core -> /source/Pinta.Core/bin/Release/net6.0/linux-x64/Pinta.Core.dll
  Pinta.Tools -> /source/Pinta.Tools/bin/Release/net6.0/linux-x64/Pinta.Tools.dll
  Pinta.Gui.Widgets -> /source/Pinta.Gui.Widgets/bin/Release/net6.0/linux-x64/Pinta.Gui.Widgets.dll
  Pinta.Tools -> /app/
  Pinta.Effects -> /source/Pinta.Effects/bin/Release/net6.0/linux-x64/Pinta.Effects.dll
  Pinta.Effects -> /app/
  Pinta.Docking -> /source/Pinta.Docking/bin/Release/net6.0/linux-x64/Pinta.Docking.dll
  Pinta -> /source/bin/linux-x64/Pinta.dll
  Pinta -> /app/
  Pinta.Resources -> /app/
  Pinta.Core -> /app/
  Pinta.Gui.Widgets -> /app/
  Pinta.Docking -> /app/
/source/Pinta.Effects/Pinta.Effects.csproj : error MSB4057: The target "CreateDeb" does not exist in the project.
/source/Pinta.Tools/Pinta.Tools.csproj : error MSB4057: The target "CreateDeb" does not exist in the project.
root@c1bbe48cf612:/source# dotnet publish -c release -o /app --no-restore --runtime linux-x64 --self-contained    
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

c  Pinta.Resources -> /source/Pinta.Resources/bin/Release/net6.0/linux-x64/Pinta.Resources.dll
  Pinta.Core -> /source/Pinta.Core/bin/Release/net6.0/linux-x64/Pinta.Core.dll
  Pinta.Tools -> /source/Pinta.Tools/bin/Release/net6.0/linux-x64/Pinta.Tools.dll
  Pinta.Gui.Widgets -> /source/Pinta.Gui.Widgets/bin/Release/net6.0/linux-x64/Pinta.Gui.Widgets.dll
  Pinta.Tools -> /app/
  Pinta.Effects -> /source/Pinta.Effects/bin/Release/net6.0/linux-x64/Pinta.Effects.dll
  Pinta.Effects -> /app/
  Pinta.Docking -> /source/Pinta.Docking/bin/Release/net6.0/linux-x64/Pinta.Docking.dll
  Pinta -> /source/bin/linux-x64/Pinta.dll
  Pinta -> /app/
  Pinta.Core -> /app/
  Pinta.Resources -> /app/
  Pinta.Gui.Widgets -> /app/
  Pinta.Docking -> /app/
root@c1bbe48cf612:/source#

What am I missing?

Originally created by @stdedos on GitHub (Apr 4, 2022). I am using the https://hub.docker.com/_/microsoft-dotnet-sdk image and I am trying to orchestrate a build process for it. Following the instructions in https://stackoverflow.com/a/47209000/2309247 didn't help: no "automagic" deb file was created ```console root@c1bbe48cf612:/source# find / -name '*.deb' root@c1bbe48cf612:/source# ``` Using the instructions from the https://github.com/quamotion/dotnet-packaging#readme didn't help either ```console root@c1bbe48cf612:/source# dotnet deb install Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-deb does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. root@c1bbe48cf612:/source# dotnet tool install --global dotnet-rpm Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable. If you are using bash, you can add it to your profile by running the following command: cat << \EOF >> ~/.bash_profile # Add .NET Core SDK tools export PATH="$PATH:/root/.dotnet/tools" EOF You can add it to the current session by running the following command: export PATH="$PATH:/root/.dotnet/tools" You can invoke the tool using the following command: dotnet-rpm Tool 'dotnet-rpm' (version '0.1.220') was successfully installed. root@c1bbe48cf612:/source# dotnet tool install --global dotnet-deb Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable. If you are using bash, you can add it to your profile by running the following command: cat << \EOF >> ~/.bash_profile # Add .NET Core SDK tools export PATH="$PATH:/root/.dotnet/tools" EOF You can add it to the current session by running the following command: export PATH="$PATH:/root/.dotnet/tools" You can invoke the tool using the following command: dotnet-deb Tool 'dotnet-deb' (version '0.1.220') was successfully installed. root@c1bbe48cf612:/source# dotnet rpm install Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-rpm does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. root@c1bbe48cf612:/source# dotnet deb install Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-deb does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. root@c1bbe48cf612:/source# cat << \EOF >> ~/.bash_profile > # Add .NET Core SDK tools > export PATH="$PATH:/root/.dotnet/tools" > EOF root@c1bbe48cf612:/source# dotnet deb install Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-deb does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. root@c1bbe48cf612:/source# dotnet-deb bash: dotnet-deb: command not found root@c1bbe48cf612:/source# dotnet^C root@c1bbe48cf612:/source# export PATH="$PATH:/root/.dotnet/tools" root@c1bbe48cf612:/source# dotnet deb install dotnet deb (0.1.220+3f7bd3c61a) Successfully installed dotnet deb. Now run 'dotnet deb' to package your application as a Debian/Ubuntu installer package root@c1bbe48cf612:/source# dotnet rpm install dotnet rpm (0.1.220+3f7bd3c61a) Successfully installed dotnet rpm. Now run 'dotnet rpm' to package your application as a RPM package root@c1bbe48cf612:/source# dotnet rpm dotnet rpm (0.1.220+3f7bd3c61a) Failed to find a .*proj file in '/source'. dotnet rpm only works if you have exactly one .*proj file in your directory. For advanced scenarios, please use 'dotnet msbuild /t:CreateRpm' root@c1bbe48cf612:/source# dotnet publish -c release -o /app --no-restore --runtime linux-x64 --self-contained /t:CreateRpm /t:CreateDeb Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Copyright (C) Microsoft Corporation. All rights reserved. Pinta.Resources -> /source/Pinta.Resources/bin/Release/net6.0/linux-x64/Pinta.Resources.dll Pinta.Core -> /source/Pinta.Core/bin/Release/net6.0/linux-x64/Pinta.Core.dll Pinta.Tools -> /source/Pinta.Tools/bin/Release/net6.0/linux-x64/Pinta.Tools.dll Pinta.Tools -> /app/ Pinta.Gui.Widgets -> /source/Pinta.Gui.Widgets/bin/Release/net6.0/linux-x64/Pinta.Gui.Widgets.dll Pinta.Effects -> /source/Pinta.Effects/bin/Release/net6.0/linux-x64/Pinta.Effects.dll Pinta.Effects -> /app/ Pinta.Docking -> /source/Pinta.Docking/bin/Release/net6.0/linux-x64/Pinta.Docking.dll Pinta -> /source/bin/linux-x64/Pinta.dll Pinta -> /app/ Pinta.Docking -> /app/ Pinta.Resources -> /app/ Pinta.Core -> /app/ Pinta.Gui.Widgets -> /app/ /source/Pinta.Effects/Pinta.Effects.csproj : error MSB4057: The target "CreateRpm" does not exist in the project. /source/Pinta.Tools/Pinta.Tools.csproj : error MSB4057: The target "CreateRpm" does not exist in the project. root@c1bbe48cf612:/source# dotnet publish -c release -o /app --no-restore --runtime linux-x64 --self-contained /t:CreateDeb Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Copyright (C) Microsoft Corporation. All rights reserved. Pinta.Resources -> /source/Pinta.Resources/bin/Release/net6.0/linux-x64/Pinta.Resources.dll Pinta.Core -> /source/Pinta.Core/bin/Release/net6.0/linux-x64/Pinta.Core.dll Pinta.Tools -> /source/Pinta.Tools/bin/Release/net6.0/linux-x64/Pinta.Tools.dll Pinta.Gui.Widgets -> /source/Pinta.Gui.Widgets/bin/Release/net6.0/linux-x64/Pinta.Gui.Widgets.dll Pinta.Tools -> /app/ Pinta.Effects -> /source/Pinta.Effects/bin/Release/net6.0/linux-x64/Pinta.Effects.dll Pinta.Effects -> /app/ Pinta.Docking -> /source/Pinta.Docking/bin/Release/net6.0/linux-x64/Pinta.Docking.dll Pinta -> /source/bin/linux-x64/Pinta.dll Pinta -> /app/ Pinta.Resources -> /app/ Pinta.Core -> /app/ Pinta.Gui.Widgets -> /app/ Pinta.Docking -> /app/ /source/Pinta.Effects/Pinta.Effects.csproj : error MSB4057: The target "CreateDeb" does not exist in the project. /source/Pinta.Tools/Pinta.Tools.csproj : error MSB4057: The target "CreateDeb" does not exist in the project. root@c1bbe48cf612:/source# dotnet publish -c release -o /app --no-restore --runtime linux-x64 --self-contained Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Copyright (C) Microsoft Corporation. All rights reserved. c Pinta.Resources -> /source/Pinta.Resources/bin/Release/net6.0/linux-x64/Pinta.Resources.dll Pinta.Core -> /source/Pinta.Core/bin/Release/net6.0/linux-x64/Pinta.Core.dll Pinta.Tools -> /source/Pinta.Tools/bin/Release/net6.0/linux-x64/Pinta.Tools.dll Pinta.Gui.Widgets -> /source/Pinta.Gui.Widgets/bin/Release/net6.0/linux-x64/Pinta.Gui.Widgets.dll Pinta.Tools -> /app/ Pinta.Effects -> /source/Pinta.Effects/bin/Release/net6.0/linux-x64/Pinta.Effects.dll Pinta.Effects -> /app/ Pinta.Docking -> /source/Pinta.Docking/bin/Release/net6.0/linux-x64/Pinta.Docking.dll Pinta -> /source/bin/linux-x64/Pinta.dll Pinta -> /app/ Pinta.Core -> /app/ Pinta.Resources -> /app/ Pinta.Gui.Widgets -> /app/ Pinta.Docking -> /app/ root@c1bbe48cf612:/source# ``` What am I missing?
Author
Owner

@Ombrelin commented on GitHub (Jul 6, 2022):

I have the same problem

@Ombrelin commented on GitHub (Jul 6, 2022): I have the same problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#118