From f99e2af701fcc77f3cc13ce340443db2a96e6ae7 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Sun, 17 Apr 2016 22:01:29 -0700 Subject: [PATCH] change example Signed-off-by: Jess Frazelle --- Makefile | 2 +- README.md | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 61ef169..8b9952e 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DOCKER_ROOTFS_IMAGE := $(IMAGE) LDFLAGS := ${LDFLAGS} \ -X main.GITCOMMIT=${GITCOMMIT} \ -X main.VERSION=${VERSION} \ - -X main.IMAGE=${IMAGE} \ + -X main.IMAGE=$(notdir $(IMAGE)) \ -X main.IMAGESHA=$(shell docker inspect --format "{{.Id}}" $(IMAGE)) BINDIR := $(CURDIR)/bin diff --git a/README.md b/README.md index dfe8fe4..f89be55 100644 --- a/README.md +++ b/README.md @@ -54,24 +54,30 @@ $ ./busybox --read-only ### Running with custom commands & args ```console -# let's make an nginx binary -$ make static IMAGE=nginx -Static container created at: ./bin/nginx -Run with ./bin/nginx +# let's make an small web server binary +$ make static IMAGE=r.j3ss.co/hello +Static container created at: ./bin/hello +Run with ./bin/hello -$ ./bin/nginx nginx -g "daemon off;" +$ ./bin/hello /hello +2016/04/18 04:59:25 Starting server on port: 8080 -# But we have no networking! Don't worry we can fix this +# But we have no networking! How can we reach it! Don't worry we can fix this # Let's install my super cool binary for setting up networking in a container $ go get github.com/jfrazelle/netns # now we can add this as a prestart hook -$ ./bin/nginx --hook prestart:netns nginx -g "daemon off;" +$ ./bin/hello --hook prestart:netns /hello +2016/04/18 04:59:25 Starting server on port: 8080 # let's get the ip file $ cat .ip 172.19.0.10 +# we can curl it +$ curl -sSL $(cat .ip):8080 +Hello World! + Success! ```