Question: I'm new in docker and I'm trying to dockerizing a .NET core app, the compiled app when I run it without a live server is should give this error.

[![enter image description here](https://i.stack.imgur.com/dakoU.png)](https://i.stack.imgur.com/dakoU.png)

the dockerfile I use to build an image for this app is

```
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env

WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o bin

WORKDIR /app/bin

ENTRYPOINT ["dotnet", "Rescue.Bridge.dll"]

```

the output when running the container is

[![enter image description here](https://i.stack.imgur.com/ShGTW.png)](https://i.stack.imgur.com/ShGTW.png)

my question is that I can't figure out what is missing/wrong so I can get the same output as the compiled version without docker?

Answer: 
You can still use `retry` or `retryWhen` observable operators as long as your service function returns `Observable`.

Using `retry`:

```js
this.infoService.getInfo()
  .pipe(
     retry(3), // you retry 3 times
     delay(1000) // each retry will start after 1 second,
  )
  .subscribe(res => {
     // success
  })

```

Using `retryWhen`:

```js
this.infoService.getInfo()
  .pipe(
     retryWhen(errors => errors.pipe(
         // define conditions for retrying with some of observable operators
     )),
  )
  .subscribe(res => {
     // success
  })

```
This is the most close solution to what I want:

```
 checkBackend() {
    console.log('Waiting for backend...');

    let infoObservable = this.infoService.getInfo().pipe(
      retryWhen(errors =>
        errors.pipe(
          delay(10000),
          tap(errorStatus => {
            //stop timeout if error
            this.stopInfoTimeOut();
            //parse the error, depending on the return from the http.get
            if (!errorStatus.includes('504')) {
              throw errorStatus;
            }
            //run timeout when trying a new request
            this.runInfoTimeout();
          })
        )
      ))

    this.infoSubscription= infoObservable.subscribe({
      next: val => {
        if (val) {
          console.log('Backend available');
          this.stopInfoTimeOut();
        }
      },
      error: val => {
        console.log(val);
        this.stopInfoTimeOut();
        this.showMessage("Backend not available, try later");
      }, 
      complete: () => {}
    })

    this.runInfoTimeout();
}

stopInfoTimeOut(){
  clearTimeout(this.infoTimeOut);
}

runInfoTimeout(){
    //timeout for non error requests, waiting to be answered
    this.infoTimeOut =setTimeout(() => {
      console.log("Backend response time out");
      this.infoSubscription.unsubscribe()
      this.showMessage("Backend not available, try later");
    }, 120000);//2 min
  }

```