How to install Node JS in Docker with a Windows Container dotnet/aspnet:6.0? - node.js

Seems like something that should be fairly simple, but since windows containers are using nano and don't have msiexec.exe to install packages with I'm not finding a well established alternative after googling for several hours now. So, how would one best do the below in a nano based windows container?
RUN msiexec.exe /i https://nodejs.org/dist/v18.7.0/node-v18.7.0-x64.msi /quiet
What I'm using:
Windows Docker Containers
dockerfile VS makes, which has a base of dotnet/aspnet:6.0 and uses dotnet/sdk:6.0 in the build stage
Base stage of dockerfile where I want to do my install of node at:
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
# install node for npm usage
RUN msiexec.exe /i https://nodejs.org/dist/v18.7.0/node-v18.7.0-x64.msi /quiet
For what it's worth, I'm use to Linux based containers and this is the first time I've tried out using Windows ones. Please correct me on anything I may have misspoken on or misrepresented.

Welcome to the Windows world! :)
On Windows, .Net has two flavors: .Net and .Net Framework. The former (.Net) was previously called .Net Core and since its renaming to .Net it has caused some confusion.
To clarify:
.Net Framework is the legacy framework on which .Net was only available in Windows.
.Net (formerly called .Net Core) is available on Windows and Linux. At first, .Net on Windows was only available on Nano Server base container images. However, recently the team made it available on the Server Core image, which supports a wider range of pre-requisites, such as MSIEXEC.
My suggestion to you is to look at the list of available tags for the image you want to use here: https://mcr.microsoft.com/en-us/product/dotnet/aspnet/tags
Also, look at the documentation of Windows containers. There's a particularity of Windows containers which is a version match requirement between container host and container. More details here: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2022%2Cwindows-11-21H2

Related

How to install dependent binaries on Azure App Service with Linux?

I have a spring boot application that I am running on Azure App Service (Linux). My application has a dependency on a binary and needs it to be present on the system. How do I install it on my App service?
I tried the following two options:
Did ssh via Kudu and installed the package ($ apk add package). But the changes are not persisted beyond /home. The dependencies were installed in other folders and when the app service was re-deployed all those dependencies were gone
Used the post deployment hook to run the command "$ apk add package" to install once the deployment finishes. This script is run as can be seen from the custom log statements but still i do not see the installed package. Even when is use apt-get it says "unable to lock administration directory"
Using a statically compiled binary is not an option for me since that has its own issues.
Thanks
For the Tomcat, Java SE and WildFly apps on App Service Linux, you can create a file at /home/startup.sh and use it to initialize the container in any way you want (Example: you can install the required packages using this script).
App Service Linux checks for the presence of /home/startup.sh at the time of startup. If it exists, it is executed. This provides web app developers with an extension point which can be used to perform necessary customization during startup, like installing necessary packages during container startup.
I think this is a common problem with Linux on Azure.
I recommend having a step back and consider one of the following options.
Run your application in a container that has all the dependencies
you are looking for.
Run your application on Linux VM IaaS instead
of Azure App Service (Linux),PaaS.
Run your application on Windows OS PaaS and add extension for your dependency.(Most likely you won't run into this problem when using Windows OS)
While I understand that none of them might be acceptable by you, but I have not found a solution for that problem in those specific circumstances.

How should a dotnet core command line application be installed on a Linux system

I'm maintaining a couple of .NET applications on GitHub. I've been getting requests to port them over to .NET Core so that they can be used on Linux systems. I would like to make the Linux users' life easy by providing some sort of package like NuGet that can be installed.
However I'm not aware of any conventions for where the executable files actually should live in the file system. Ideally, the binaries will be deployed in directories on the PATH, but I'm not sure what convetions dotnet Core uses when it comes to the physical locations of .NET assemblies.
Ideally, I'd like to deploy:
The main assembly, pytocs.dll
A shell script that asks the dotnet core executive to launch the tool:
#!/bin/bash
dotnet pytocs.dll "$#"
but I don't know where those two file should go.

How create build .net with MSBuild in Jenkins on Server Linux

I tried to configure jenkins that is mounted on a server with linux, is it possible to install msbuild.exe to compile a .NET application? or is it necessary for Jenkins to be on a windows server?
The .NET Core SDK can be installed on Linux and comes with a tool called dotnet which can work pretty similar to MSBuild when you run it as dotnet build.
It depends on what purpose. If it is to study, I recommend installing Jenkins on a Windows Server, then installing the .Net Framework SDK that you want to use.
If it is a productive environment, I recommend installing Jenkins Master on Linux Server and a Slave on Windows Server, then installing the .Net Framework SDK that you want to use. So you do not overload the Jenkins as you compile.
If you look at the version of the .Net Framework SDK, because if any font needs something specific, you will have to install the Microsoft Windows SDK.
For configuration see this link.

msdeploy (Web deploy) installation in a container

I try to containerize a third party application running on IIS and Windows server. To do that, they supply to me a powershell script which is using Web deploy 3.
My problem is I can't install it, I always have this error code :
MSI install return value for product 'Web Deploy 3.6 ... is '1603'
The version 2 is installing though, but it's the version 3 which is required. I've also tried to install it with chocolatey, but I have the exact same error.
Here the part of the Dockerfile causing troubles :
FROM microsoft/windowsservercore-insider:10.0.17093.1000
[...]
# Register dll (the web say this can solve the error)
RUN regsvr32.exe %windir%\syswow64\vbscript.dll /s
# Copy The msi installer for web deploy 3.6
COPY webdeploy.msi C:\\Temp\\webdeploy.msi
WORKDIR C:\\Temp
# Install all webdeploy features
RUN msiexec /i webdeploy.msi LicenseAccepted="0" ADDLOCAL=ALL /quiet /qn /passive /norestart
Please do note I'am using the insider version because I need the MSMQ feature which is not released yet (It's a proof of concept).
Is there any requirement needed by webdeploy that I don't know and which is missing in the container version ?
It seems there is a bug in the preview build (as mentioned by #Gregory Suvalian). Using the last one (17623) seems to correct the problem.

shinyproxy basic basics (+ some general web knowledge)

The problem
While searching for ways to deploy shiny apps I stumbled across ShinyProxy. From what I understand it's an alternative for ShinyServer. However, I lack some (very basic) knowledge to follow the guide provided.
The questions
Can ShinyProxy be installed just on any bought/rented server? Do I need to preinstall some other software?
Where do I type in the commands provided in the ShinyProxy guide?
Does Docker need to be installed on the server or is it a tool to deploy to the server and is thus installed locally?
The ShinyProxy guide misses a point about installing ShinyProxy. Why? Is it not installed (or is installation so obvious)?
I couldn't actually find instructions on how to run a shiny app with ShinyProxy.
The authors of ShinyProxy can probably provide a much better answer, but here is my understanding:
Your server needs to support Java 8 and Docker (or you can install Java 8 and Docker on your server).
Assuming you logon to your server via SSH, the commands will be typed in the SSH terminal.
Yes Docker needs to be installed on the server
It appears that ShinyProxy does not need to be installed. You just need to download it (the shinyproxy-0.5.0.jar file) to a location on the server, and then run java -jar shinyproxy-0.5.0.jar (in your SSH terminal)
To run a Shiny app, you need to package it as an R package first, then build a Docker image for the R package. The app is then actually running inside a Docker container. You also need a configuration file to tell ShinyProxy where to look for your Docker image. Example is here https://github.com/openanalytics/shinyproxy-demo

Resources