1

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?

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • 1
    The error you get is a known bug that we are trying to fix right now: https://github.com/redhat-developer/s2i-dotnetcore/issues/263. Try adding `-e DOTNET_SDK_BASE_VERSION=2.1.500` to the s2i command to make things work for now. – omajid Mar 04 '19 at 16:24
  • @omajid This appears to solve _that_ problem. I still have problems with our coorporate proxy, but that is another matter. If you write up a full answer, I'll accept it. – Thorbjørn Ravn Andersen Mar 04 '19 at 16:41
  • 1
    Look into the proxy variables documented here: https://github.com/redhat-developer/s2i-dotnetcore/tree/master/2.1/build#environment-variables – omajid Mar 04 '19 at 16:43

0 Answers0