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 "nanoserver" variants using "hello.txt" + powershell #24

Merged
merged 1 commit into from
Nov 18, 2016
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.md
*.sh
*/hello
*/nanoserver/hello.txt
.dockerignore
.git
Dockerfile*
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ before_script:

script:
- ./update.sh
- test -z "$(git status --porcelain '*/hello')"
- test -z "$(git status --porcelain '*/hello' '*/nanoserver/hello.txt')"
- docker build -t "$image" hello-world
- ~/official-images/test/run.sh "$image"

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# explicitly use Debian for maximum cross-architecture compatibility
FROM debian:jessie
FROM debian:jessie-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
Expand All @@ -10,8 +10,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /usr/src/hello
COPY . .

RUN set -x \
&& make clean all test \
&& ls -l */hello
RUN set -ex; \
make clean all test; \
find \( -name 'hello' -or -name 'hello.txt' \) -exec ls -l '{}' +

CMD ["./hello-world/hello"]
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ all: $(C_TARGETS)
$(C_TARGETS): hello.c
$(CC) $(CFLAGS) -o '$@' -D DOCKER_IMAGE='"$(@D)"' -D DOCKER_GREETING="\"$$(cat '$(@D)/greeting.txt')\"" '$<'
strip -R .comment -s '$@'
@mkdir -p '$(@D)/nanoserver'
'$@' | sed -e 's/an Ubuntu container/a Nano Server container/g' -e 's!ubuntu bash!microsoft/nanoserver powershell!g' > '$(@D)/nanoserver/hello.txt'

.PHONY: clean
clean:
Expand Down
13 changes: 12 additions & 1 deletion generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ cat <<-EOH
Maintainers: Tianon Gravi <[email protected]> (@tianon),
Joseph Ferguson <[email protected]> (@yosifkit)
GitRepo: https://github.com/docker-library/hello-world.git
Directory: $image
EOH

commit="$(dirCommit "$image")"
Expand All @@ -43,4 +42,16 @@ echo
cat <<-EOE
Tags: latest
GitCommit: $commit
Directory: $image
EOE

if [ -d "$image/nanoserver" ]; then
commit="$(dirCommit "$image/nanoserver")"

echo
cat <<-EOE
Tags: nanoserver
GitCommit: $commit
Directory: $image/nanoserver
EOE
fi
3 changes: 3 additions & 0 deletions hello-seattle/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
21 changes: 21 additions & 0 deletions hello-seattle/nanoserver/hello.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

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.
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 Nano Server container with:
$ docker run -it microsoft/nanoserver powershell

Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

3 changes: 3 additions & 0 deletions hello-world/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
21 changes: 21 additions & 0 deletions hello-world/nanoserver/hello.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

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.
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 Nano Server container with:
$ docker run -it microsoft/nanoserver powershell

Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

3 changes: 3 additions & 0 deletions hola-mundo/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM microsoft/nanoserver
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]
21 changes: 21 additions & 0 deletions hola-mundo/nanoserver/hello.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

¡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.
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 Nano Server container with:
$ docker run -it microsoft/nanoserver powershell

Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

5 changes: 3 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ set -x

docker build -f Dockerfile.build -t hello-world:build .

rm -rf */hello
docker run --rm hello-world:build sh -c 'tar --create */hello' | tar --extract --wildcards '*/hello'
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

for h in */hello; do
d="$(dirname "$h")"
"$h" > /dev/null
docker build -t hello-world:"test-$d" "$d"
docker run --rm hello-world:"test-$d"
done
ls -l */nanoserver/hello.txt || :