# Docker containers on Spaces

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-containers-on-spaces%2F86002%3E%5C
**Category:** Spaces\
**Created:** [May 9, 2024, 6:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-containers-on-spaces%2F86002 "2024-05-09T18:20:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman0807](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@aman0807](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faman0807)%5C
**Post date:** [May 9, 2024, 6:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-containers-on-spaces%2F86002%2F1 "2024-05-09T18:20:03Z")

</div>

I am following this tutorial to learn docker with hf spaces.

> **[Build Machine Learning Apps with Hugging Face | Docker](https://www.docker.com/blog/build-machine-learning-apps-with-hugging-faces-docker-spaces/)**
>
> Learn about the Hugging Face Hub and how to use its Docker Spaces to build machine learning apps effortlessly.

This is the code in app.py.

```auto
from fastapi import FastAPI
from transformers import pipeline

app = FastAPI(docs_url="/", openapi_url="/api/v1/openapi.json")

pipe = pipeline('text2text-generation', 
                model='google/flan-t5-small')

@app.get("/generate")
def generate(text:str):

    output = pipe(text)
    return {"output": output[0]["generated_text"]}

```

I’m getting following error -  
Failed to load API definition

#### Fetch error

response status is 404 /api/v1/openapi.json

I have tried without the openapi\_url argument inside **FastAPI()** (as written in the blog)  
but that is also giving the same error.

Would appreciate some help in how to resolve this.

PS: I ran the docker image locally and it’s not giving any issues.
