-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Image on Windows Base Image #439 #2332
Conversation
@microsoft-github-policy-service agree |
Thanks for the contribution! Would you please confirm: If you would like Azurite to release windows based docker image, please also add:
If you just would like to keep this script in Azurite repo, would you please: |
Hi @blueww, I would like the image to be released, that way it's easier to use & make it easier for the windows image to stay up-to-date with the latest version of Azurite. I've added the build steps I think are neccesary to the package.json & azure-pipelines.yml. |
It looks there are something wrong with the pipeline change, only 3 PR checks run, but originally there are 30+ PR checks. |
"docker:publish-arm64": "cross-var docker push xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-arm64", | ||
"docker:create-manifest-versioned": "cross-var docker manifest create xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-amd64 xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-arm64", | ||
"docker:create-manifest-latest": "cross-var docker manifest create xstoreazurite.azurecr.io/public/azure-storage/azurite:latest xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-amd64 xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-arm64", | ||
"docker:create-manifest-versioned": "cross-var docker manifest create xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-amd64 xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-windows-amd64 xstoreazurite.azurecr.io/public/azure-storage/azurite:$npm_package_version-arm64", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check what's the effect after publish the manifest.
With the originally manifest, when user run Azurite docker image without specifying platform, docker will choose the docker image most match the current platform (ARM64 platform will choose AMD64 docker image, AMD64 platform will choose AMD64 docker image). After the windows-amd64 image is added, what will happen when user run Azurite docker image without specifying platform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The platform is chooses includes the os name, hence it currently throwing an error on windows ( no matching manifest for windows/amd64 in the manifest list entries
) adding this image will add that specific platform to the manifest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With current Azurite release (before the change), I will install AMD64 docker image in my machine (my machine is windows with AMD64).
So after your change, what will happen on different platform/OS?
And for the error, do you mean you will resolve it, or it's already resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are running Docker in Windows Container mode (this is an option within Docker-Desktop), with the current release this will throw an error.
After the change, the other platforms will be unaffected (since they will use the linux/amd64 image).
You can view the platform docker is running internally on with docker info -f "{{.OSType}}"
. For me this gives windows
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get it. Thanks!
And on my windows machine run docker info -f "{{.OSType}}"
, will get result "linux".
I tried to build windows based image in code space, and meet following error:
|
Interesting enough I do not encounter that error when running it locally. |
If possible, I would suggest you testing the build docker image step in the github code space (it's linux based), and make sure it passes. |
It is not possible to build or run a Windows container on a Linux machine, as far as I know there isn't a (proper) way to run Windows on a Github codespace. |
It looks the PR check still fail. |
Adding workdir change to node base image
…ows containers documentation.
…sage on custom entrypoint
The PR Checks succeeded, are there any stoppers left for this PR? |
@XiaoningLiu , @EmmaZhu |
Dockerfile.Windows
Outdated
|
||
WORKDIR C:\\Node\\node-v20.0.0-win-x64\\ | ||
|
||
CMD "azurite -l c:/data --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first docker run command sample in Readme file(link) will fail per my test.
It looks the command in line 71 doesn't work.
D:\code\azurite>docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 xstoreazurite.azurecr.io/public/azure-storage/azurite:latest
'"azurite -l c:/data --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0' is not recognized as an internal or external command, operable program or batch file.
If we run with customized command like following, it works:
D:\code\azurite>docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 xstoreazurite.azurecr.io/public/azure-storage/azurite:latest azurite --blobHost 0.0.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should function now again, there is some weird escaping done with the CMD command on Windows containers
Thanks @jwdb for the fix! Would you please help to review and see if the change is good for you? |
With this PR it's possible to build a Windows version of the Azurite container. I've not added the required steps to the package.json since the current steps very much look internally used and I would be unable to test them.
It is based upon the work from @shanrath in the issue (#439), expanding it with a NodeJS baseimage because of the lack of a proper nodejs windows baseimage that can be trusted to be updated regularly.
The image is based upon the LTSC 2022 version of Windows Nanoserver.
Thanks for contribution! Please go through following checklist before sending PR.
PR Branch Destination
main
branch.legacy-dev
branch.Always Add Test Cases
Make sure test cases are added to cover the code change.
Add Change Log
Add change log for the code change in
Upcoming Release
section inChangeLog.md
.Development Guideline
Please go to CONTRIBUTION.md for steps about setting up development environment and recommended Visual Studio Code extensions.