Tools, FAQ, Tutorials:
Build a Dummy Windows Image
How to do a dummy image from the "microsoft/dotnet-samples" Docker image?
✍: FYIcenter.com
If you want play with the "microsoft/dotnet-samples" Docker image, you should build a dummy Docker image using it as the base.
1. Create a Dockerfile to define the new image:
C:\fyicenter> type DummyImage FROM microsoft/dotnet-samples ENTRYPOINT ["PowerShell", "/help", ""]
2. Build the new image:
C:\fyicenter> docker build --file DummyImage --tag dummy . Sending build context to Docker daemon 12.87MB Step 1/2 : FROM microsoft/dotnet-samples ---> afca1083bf22 Step 2/2 : ENTRYPOINT ["PowerShell", "/help", ""] ---> Running in 4356fe17e203 Removing intermediate container 4356fe17e203 ---> 23843a8787b6 Successfully built 23843a8787b6 Successfully tagged dummy:latest
3. Run the new image:
C:\fyicenter> docker run --name dummy dummy PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>] [-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive] [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] [-WindowStyle <style>] [-EncodedCommand <Base64EncodedCommand>] [-ConfigurationName <string>] [-File <filePath> <args>] [-ExecutionPolicy <ExecutionPolicy>] [-Command { - | <script-block> [-args <arg-array>] | <string> [<CommandParameters>] } ] PowerShell[.exe] -Help | -? | /? ... C:\fyicenter> docker rm dummy
Ok, we are able to build a new image from the "microsoft/dotnet-samples" image and changed the default command to "PowerShell /help".
⇒ Run CMD Commands in Dockerfile
⇐ PATH Directories of Windows Container
2022-02-02, 773🔥, 0💬
Popular Posts:
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...
How to access Request body from "context.Request.Body" object in Azure API Policy? Request body is t...
How to create the Hello-3.0.epub package? I have all required files to create Hello-3.0.epub. To cre...
How to use the "set-body" Policy Statement for an Azure API service operation? The "set-body" Policy...
What is EPUB 2.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 2.0 Metadata "dc:publisher" ...