I am currently testing a small project and developing within the Azure ML notebook environemnt. Due to the confidential issue, I have to test within the Azure. I have a python script that I would like to push into the docker container and to the Azure container registry and subsequently use streamlit/gradio or fast api to do a simple web app demo. I am wondering, what is the best way to go about this without leaving the azure workspace. I see a lot of tutorial building in your local environment, but that would not be feasible for me.
*Is there a way to build such docker from the azure ml notebook and push into the registry?
*Using gradio/streamlit within azure notebook is also not possible as the the web portal needs to be hosted so quick testing of the layout is also kind of nightmare. Any suggestion on that?
Thank you
Dockerfile file:
# Use the official Python image from Docker Hub
FROM python:3.8-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any dependencies
RUN pip install -r requirements.txt
# Expose port 8501 for Streamlit
EXPOSE 8501
# Run the Streamlit app
CMD ["streamlit", "run", "testlikeapro.py"]
Then build the docker image using !docker build -t your-image-name:tag .
I am able to see the docker image in below.
Then Login into Azure Container Registry using az acr login --name your-Acr-name
docker build -t your-Acr-name.azurecr.io/belikepro:latest .
Successfully the image is pushed into ACR registries.
Result: