-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
docker build -f .\windows\Dockerfile.build -t builder .\windows\. | ||
docker create --name out builder | ||
docker cp out:hello.exe .\windows\. | ||
docker rm out | ||
docker build -t hello-world:windows .\windows\. | ||
docker run hello-world:windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM microsoft/nanoserver | ||
COPY hello.exe / | ||
CMD ["hello.exe"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM microsoft/windowsservercore | ||
|
||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] | ||
|
||
RUN Install-WindowsFeature NET-Framework-45-Core | ||
RUN Invoke-WebRequest "https://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe" \ | ||
-OutFile visualcppbuildtools_full.exe -UseBasicParsing ; \ | ||
Start-Process -FilePath 'visualcppbuildtools_full.exe' -ArgumentList '/quiet', '/NoRestart' -Wait ; \ | ||
Remove-Item .\visualcppbuildtools_full.exe | ||
|
||
RUN [Environment]::SetEnvironmentVariable('PATH', ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio 14.0\VC\bin\amd64;' + ${Env:ProgramFiles(x86)} + '\Windows Kits\10\bin\x64;' + $env:PATH, [EnvironmentVariableTarget]::Machine); | ||
|
||
RUN pushd 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC' ; \ | ||
cmd /c 'vcvarsall.bat amd64&set' | foreach { if ($_ -match '=') { $v = $_.split('='); setx /M $v[0] $v[1] } } ; \ | ||
popd | ||
|
||
ADD hello.c . | ||
RUN cl /D_WIN32_WINNT=0x0A00 /D_WINVER=0x0A00 hello.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include<stdio.h> | ||
|
||
const char message[] = | ||
"\n" | ||
"Hello from Docker!\n" | ||
"This message shows that your installation appears to be working correctly.\n" | ||
"\n" | ||
"To generate this message, Docker took the following steps:\n" | ||
" 1. The Docker client contacted the Docker daemon.\n" | ||
" 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n" | ||
" 3. The Docker daemon created a new container from that image which runs the\n" | ||
" executable that produces the output you are currently reading.\n" | ||
" 4. The Docker daemon streamed that output to the Docker client, which sent it\n" | ||
" to your terminal.\n" | ||
"\n" | ||
"To try something more ambitious, you can run an Nanoserver container with:\n" | ||
" > docker run -it microsoft/nanoserver powershell\n" | ||
"\n" | ||
"Share images, automate workflows, and more with a free Docker Hub account:\n" | ||
" https://hub.docker.com\n" | ||
"\n" | ||
"For more examples and ideas, visit:\n" | ||
" https://docs.docker.com/engine/userguide/\n" | ||
"\n"; | ||
|
||
|
||
int main() | ||
{ | ||
printf(message); | ||
return 0; | ||
} |