Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.8k stars 320 forks source link

Azurite does not launch in a docker image #2365

Closed Arash-Sabet closed 7 months ago

Arash-Sabet commented 7 months ago

Which service(blob, file, queue, table) does this issue concern?

All

Which version of the Azurite was used?

Presumably the latest version

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

npm

What's the Node.js version?

Presumably the latest version

What problem was encountered?

Azurite does not launch in a docker image as communication with it over port# 10000 shows connection failure

Steps to reproduce the issue?

We followed the steps outlined in this article to build a k8s Azure DevOps agent. We augmented the docker yaml file to include Azurite in the docker image to use its instance in our integration tests run by the build pipelines. The code snippet to include Azurite is per below:

RUN sudo apt-get -y install nodejs
RUN sudo apt-get install -y nodejs npm
RUN sudo npm install -g azurite
RUN sudo npm fund
RUN sudo mkdir azurite
RUN sudo azurite --silent --location azuritefiles --debug azuritefiles\debug.log &

All build steps of our C# solution pass successfully using this k8s-backed build agent. Unfortunately, we realize the following error message produced by our Xunit integration tests when running them in the Azure DevOps pipeline:

Connection refused (127.0.0.1:10000)

The only architectural difference between our image and the one produced by the aforementioned article is that we are using Ubuntu 22.04 instead of Ubuntu 20.04.

Have you found a mitigation/solution?

No

blueww commented 7 months ago

@Arash-Sabet

Do you run test inside same docker image with Azurite, or outside the docker image which include Azurite?

For your reference, this is Azurite docker file, and it bind Azurite blobHost to 0.0.0.0 by default on docker image, and when start Azurite docker image need map 10000:10000 port to make sure the Azurite blob endpoint can be access outside of Azurite. See more details in https://github.com/Azure/Azurite?tab=readme-ov-file#run-azurite-v3-docker-image

Arash-Sabet commented 7 months ago

@blueww The tests are run inside the docker image. So, should I use the IP address of 0.0.0.0 in the Xunit tests?

blueww commented 7 months ago

@Arash-Sabet

I might still need some time to investigate this issue. Would you please share the Azurite debug log which can help the investigation?

Besides that, could you also try to start Azurite with parameter: --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0

Arash-Sabet commented 7 months ago

@Arash-Sabet

I might still need some time to investigate this issue. Would you please share the Azurite debug log which can help the investigation?

Besides that, could you also try to start Azurite with parameter: --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0

I cannot access the log information as the docker image is a part of a k8s cluster. I will try the azurite per your suggestion a bit later on but bottom line the issue per my description should not happen. @blueww

Arash-Sabet commented 7 months ago

Running azurite on the IP address of 0.0.0.0 worked.

blueww commented 7 months ago

Good to the issue is resolved by running Azurite with host as 0.0.0.0 I will close this issue.

Feel free to contact us again if need any further assistance on Azurite.

Arash-Sabet commented 7 months ago

Thanks for the help @blueww