I have a Visual Studio application which we would like to build and deploy with OpenShift, and have already a success doing a manual build by pointing to the github repository holding the sources. As far as I can see this mean that OpenShift uses s2i
to process the repository contents and create the docker image which we then can deploy. This works!
I need to automate this and I am not familiar with the .NET ecosystem, so at first I would like to replicate the current behavior. I have previously managed to build with a suitable SDK image, but that work was lost by accident, and Redhat really want s2i used, so therefore this is what I am looking at now. If another approach is better, I am very open for that.
To my understanding means that we need to locate a suitable Linux dotnetcore SDK image to build it with. The manual primarily refers to Redhat images (requiring a valid subscription) but also refers to registry.centos.org/dotnet/dotnet-21-centos7:latest
which I have then tried to use.
The full build command so far is:
s2i build --loglevel 4 https://github.com/.... --context-dir=TPCIP.Web --ref=develop registry.centos.org/dotnet/dotnet-21-centos7:latest tpcip
Which correctly checks out the remote repository at the develop branch, but then fails with:
I0304 17:01:50.142784 17028 sti.go:711] ---> Installing application source...
I0304 17:01:50.154784 17028 sti.go:715] A compatible SDK version for global.json version: [2.1.300] from [/opt/app-root/global.json] was not found
I0304 17:01:50.154784 17028 sti.go:715] Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
I0304 17:01:50.154784 17028 sti.go:715] https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
Not being familar with this ecosystem I do not know how to proceed from here. Suggestions?
EDIT: Poking inside I saw:
bash-4.2$ dotnet --list-sdks
2.1.503 [/opt/rh/rh-dotnet21/root/usr/lib64/dotnet/sdk]
bash-4.2$ exit
So it is too new?