Create nanoserver variant

Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
pull/1/head
Stefan Scherer 8 years ago
parent ae76a8977c
commit 4a0d07dc42
No known key found for this signature in database
GPG Key ID: 5966AEAC37E957FA

1
.gitignore vendored

@ -6,6 +6,7 @@
# Folders
_obj
_test
tmp
# Architecture specific extensions/prefixes
*.[568vq]

@ -1,11 +1,7 @@
FROM ubuntu:14.04
FROM microsoft/nanoserver
RUN apt-get update && apt-get install -y golang-go
RUN apt-get install bash
ADD . /app
WORKDIR /app
RUN go build -o http
COPY tmp /
ENV PORT 8000
EXPOSE 8000
CMD ["/app/http"]
CMD ["\\http.exe"]

@ -0,0 +1,6 @@
FROM golang:nanoserver
COPY . /code
WORKDIR /code
RUN go build http.go

@ -1,10 +1,9 @@
whoami
======
# whoami for Windows
Simple HTTP docker service that prints it's container ID
$ docker run -d -p 8000:8000 --name whoami -t jwilder/whoami
$ docker run -d -p 8000:8000 --name whoami -t stefanscherer/whoami-windows
736ab83847bb12dddd8b09969433f3a02d64d5b0be48f7a5c59a594e3a6a3541
$ curl $(hostname --all-ip-addresses | awk '{print $1}'):8000
$ iwr http://$(docker inspect -f '{{ .NetworkSettings.Networks.nat.IPAddress }}' whoami):8000
I'm 736ab83847bb

@ -0,0 +1,8 @@
#!/bin/bash
docker build -t httpbuild -f Dockerfile.build .
docker rm -f httpbuild
docker create --name httpbuild httpbuild
rm -rf tmp
mkdir tmp
docker cp httpbuild:/code/http.exe tmp
docker build -t whoami .
Loading…
Cancel
Save