Add Nano Server 1803 variants

This commit is contained in:
Tianon Gravi 2018-07-09 16:14:42 -07:00
parent d49eb12290
commit 7c49831fd4
18 changed files with 103 additions and 11 deletions

View File

@ -1,7 +1,7 @@
*.md
*.sh
**/hello **/hello
**/nanoserver*/hello.txt **/nanoserver*/hello.txt
*.md
*.sh
.dockerignore .dockerignore
.git .git
Dockerfile* Dockerfile*

View File

@ -0,0 +1,3 @@
FROM scratch
COPY hello /
CMD ["/hello"]

View File

@ -0,0 +1,3 @@
FROM microsoft/nanoserver:XXX
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]

View File

@ -12,10 +12,10 @@ $(C_TARGETS): hello.c
$(CC) $(CFLAGS) -o '$@' -D DOCKER_IMAGE='"$(notdir $(@D))"' -D DOCKER_GREETING="\"$$(cat 'greetings/$(notdir $(@D)).txt')\"" -D DOCKER_ARCH='"$(TARGET_ARCH)"' '$<' $(CC) $(CFLAGS) -o '$@' -D DOCKER_IMAGE='"$(notdir $(@D))"' -D DOCKER_GREETING="\"$$(cat 'greetings/$(notdir $(@D)).txt')\"" -D DOCKER_ARCH='"$(TARGET_ARCH)"' '$<'
$(STRIP) -R .comment -s '$@' $(STRIP) -R .comment -s '$@'
@if [ '$(TARGET_ARCH)' = 'amd64' ]; then \ @if [ '$(TARGET_ARCH)' = 'amd64' ]; then \
for winVariant in nanoserver-sac2016 nanoserver-1709; do \ for winVariant in nanoserver-sac2016 nanoserver-1709 nanoserver-1803; do \
mkdir -p "$(@D)/$$winVariant"; \ mkdir -p "$(@D)/$$winVariant"; \
'$@' | sed \ '$@' | sed \
-e 's/[(]$(TARGET_ARCH)[)]/(windows-$(TARGET_ARCH))/g' \ -e 's/[(]$(TARGET_ARCH)[)]/(windows-$(TARGET_ARCH), '"$$winVariant"')/g' \
-e 's/an Ubuntu container/a Windows Server container/g' \ -e 's/an Ubuntu container/a Windows Server container/g' \
-e 's!ubuntu bash!microsoft/windowsservercore powershell!g' \ -e 's!ubuntu bash!microsoft/windowsservercore powershell!g' \
-e 's![$$] docker!PS C:\\> docker!g' \ -e 's![$$] docker!PS C:\\> docker!g' \

View File

@ -5,7 +5,7 @@ This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-seattle" image from the Docker Hub. 2. The Docker daemon pulled the "hello-seattle" image from the Docker Hub.
(windows-amd64) (windows-amd64, nanoserver-1709)
3. The Docker daemon created a new container from that image which runs the 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading. executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it 4. The Docker daemon streamed that output to the Docker client, which sent it

View File

@ -0,0 +1,3 @@
FROM microsoft/nanoserver:1803
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]

View File

@ -0,0 +1,22 @@
Hello from DockerCon 2016 (Seattle)!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-seattle" image from the Docker Hub.
(windows-amd64, nanoserver-1803)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run a Windows Server container with:
PS C:\> docker run -it microsoft/windowsservercore powershell
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

View File

@ -5,7 +5,7 @@ This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-seattle" image from the Docker Hub. 2. The Docker daemon pulled the "hello-seattle" image from the Docker Hub.
(windows-amd64) (windows-amd64, nanoserver-sac2016)
3. The Docker daemon created a new container from that image which runs the 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading. executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it 4. The Docker daemon streamed that output to the Docker client, which sent it

View File

@ -5,7 +5,7 @@ This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(windows-amd64) (windows-amd64, nanoserver-1709)
3. The Docker daemon created a new container from that image which runs the 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading. executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it 4. The Docker daemon streamed that output to the Docker client, which sent it

View File

@ -0,0 +1,3 @@
FROM microsoft/nanoserver:1803
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]

View File

@ -0,0 +1,22 @@
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(windows-amd64, nanoserver-1803)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run a Windows Server container with:
PS C:\> docker run -it microsoft/windowsservercore powershell
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

View File

@ -5,7 +5,7 @@ This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(windows-amd64) (windows-amd64, nanoserver-sac2016)
3. The Docker daemon created a new container from that image which runs the 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading. executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it 4. The Docker daemon streamed that output to the Docker client, which sent it

View File

@ -5,7 +5,7 @@ This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hola-mundo" image from the Docker Hub. 2. The Docker daemon pulled the "hola-mundo" image from the Docker Hub.
(windows-amd64) (windows-amd64, nanoserver-1709)
3. The Docker daemon created a new container from that image which runs the 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading. executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it 4. The Docker daemon streamed that output to the Docker client, which sent it

View File

@ -0,0 +1,3 @@
FROM microsoft/nanoserver:1803
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]

View File

@ -0,0 +1,22 @@
¡Hola de DockerCon EU 2015 (Barcelona)!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hola-mundo" image from the Docker Hub.
(windows-amd64, nanoserver-1803)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run a Windows Server container with:
PS C:\> docker run -it microsoft/windowsservercore powershell
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

View File

@ -5,7 +5,7 @@ This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon. 1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hola-mundo" image from the Docker Hub. 2. The Docker daemon pulled the "hola-mundo" image from the Docker Hub.
(windows-amd64) (windows-amd64, nanoserver-sac2016)
3. The Docker daemon created a new container from that image which runs the 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading. executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it 4. The Docker daemon streamed that output to the Docker client, which sent it

View File

@ -62,7 +62,7 @@ for arch in "${arches[@]}"; do
EOE EOE
done done
for winVariant in nanoserver-sac2016 nanoserver-1709; do for winVariant in nanoserver-{sac2016,1709,1803}; do
winArches=( *"/$image/$winVariant/hello.txt" ) winArches=( *"/$image/$winVariant/hello.txt" )
winArches=( "${winArches[@]%"/$image/$winVariant/hello.txt"}" ) winArches=( "${winArches[@]%"/$image/$winVariant/hello.txt"}" )

View File

@ -10,6 +10,16 @@ docker build -f Dockerfile.build -t hello-world:build .
rm -rf */hello */nanoserver*/hello.txt rm -rf */hello */nanoserver*/hello.txt
docker run --rm hello-world:build sh -c 'find \( -name hello -or -name hello.txt \) -print0 | xargs -0 tar --create' | tar --extract --verbose docker run --rm hello-world:build sh -c 'find \( -name hello -or -name hello.txt \) -print0 | xargs -0 tar --create' | tar --extract --verbose
find -name hello -type f -exec dirname '{}' ';' | xargs -n1 -i'{}' cp Dockerfile-linux.template '{}/Dockerfile'
find -name hello.txt -type f -exec dirname '{}' ';' | xargs -n1 -i'{}' cp Dockerfile-windows.template '{}/Dockerfile'
for h in */*/nanoserver-*/Dockerfile; do
nano="$(dirname "$h")"
nano="$(basename "$nano")"
nano="${nano#nanoserver-}"
sed -i 's!FROM .*!FROM microsoft/nanoserver:'"$nano"'!' "$h"
done
for h in amd64/*/hello; do for h in amd64/*/hello; do
d="$(dirname "$h")" d="$(dirname "$h")"
b="$(basename "$d")" b="$(basename "$d")"
@ -17,4 +27,5 @@ for h in amd64/*/hello; do
docker build -t hello-world:"test-$b" "$d" docker build -t hello-world:"test-$b" "$d"
docker run --rm hello-world:"test-$b" docker run --rm hello-world:"test-$b"
done done
ls -lh */*/{hello,nanoserver*/hello.txt} || : ls -lh */*/{hello,nanoserver*/hello.txt} || :