Skip to content
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

Add Nano Server 1803 variants #48

Merged
merged 1 commit into from
Jul 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.md
*.sh
**/hello
**/nanoserver*/hello.txt
*.md
*.sh
.dockerignore
.git
Dockerfile*
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
COPY hello /
CMD ["/hello"]
3 changes: 3 additions & 0 deletions Dockerfile-windows.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver:XXX
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"' '$<'
$(STRIP) -R .comment -s '$@'
@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"; \
'$@' | 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!ubuntu bash!microsoft/windowsservercore powershell!g' \
-e 's![$$] docker!PS C:\\> docker!g' \
Expand Down
2 changes: 1 addition & 1 deletion amd64/hello-seattle/nanoserver-1709/hello.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)
(windows-amd64, nanoserver-1709)
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
Expand Down
3 changes: 3 additions & 0 deletions amd64/hello-seattle/nanoserver-1803/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver:1803
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
22 changes: 22 additions & 0 deletions amd64/hello-seattle/nanoserver-1803/hello.txt
Original file line number Diff line number Diff line change
@@ -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/

2 changes: 1 addition & 1 deletion amd64/hello-seattle/nanoserver-sac2016/hello.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)
(windows-amd64, nanoserver-sac2016)
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
Expand Down
2 changes: 1 addition & 1 deletion amd64/hello-world/nanoserver-1709/hello.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)
(windows-amd64, nanoserver-1709)
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
Expand Down
3 changes: 3 additions & 0 deletions amd64/hello-world/nanoserver-1803/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver:1803
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
22 changes: 22 additions & 0 deletions amd64/hello-world/nanoserver-1803/hello.txt
Original file line number Diff line number Diff line change
@@ -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/

2 changes: 1 addition & 1 deletion amd64/hello-world/nanoserver-sac2016/hello.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)
(windows-amd64, nanoserver-sac2016)
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
Expand Down
2 changes: 1 addition & 1 deletion amd64/hola-mundo/nanoserver-1709/hello.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)
(windows-amd64, nanoserver-1709)
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
Expand Down
3 changes: 3 additions & 0 deletions amd64/hola-mundo/nanoserver-1803/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver:1803
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
22 changes: 22 additions & 0 deletions amd64/hola-mundo/nanoserver-1803/hello.txt
Original file line number Diff line number Diff line change
@@ -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/

2 changes: 1 addition & 1 deletion amd64/hola-mundo/nanoserver-sac2016/hello.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)
(windows-amd64, nanoserver-sac2016)
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
Expand Down
2 changes: 1 addition & 1 deletion generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for arch in "${arches[@]}"; do
EOE
done

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

Expand Down
11 changes: 11 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@ docker build -f Dockerfile.build -t hello-world:build .
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

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
d="$(dirname "$h")"
b="$(basename "$d")"
"$h" > /dev/null
docker build -t hello-world:"test-$b" "$d"
docker run --rm hello-world:"test-$b"
done

ls -lh */*/{hello,nanoserver*/hello.txt} || :