change example
Signed-off-by: Jess Frazelle <jess@mesosphere.com>
This commit is contained in:
parent
736052e309
commit
f99e2af701
2 changed files with 14 additions and 8 deletions
2
Makefile
2
Makefile
|
@ -22,7 +22,7 @@ DOCKER_ROOTFS_IMAGE := $(IMAGE)
|
||||||
LDFLAGS := ${LDFLAGS} \
|
LDFLAGS := ${LDFLAGS} \
|
||||||
-X main.GITCOMMIT=${GITCOMMIT} \
|
-X main.GITCOMMIT=${GITCOMMIT} \
|
||||||
-X main.VERSION=${VERSION} \
|
-X main.VERSION=${VERSION} \
|
||||||
-X main.IMAGE=${IMAGE} \
|
-X main.IMAGE=$(notdir $(IMAGE)) \
|
||||||
-X main.IMAGESHA=$(shell docker inspect --format "{{.Id}}" $(IMAGE))
|
-X main.IMAGESHA=$(shell docker inspect --format "{{.Id}}" $(IMAGE))
|
||||||
|
|
||||||
BINDIR := $(CURDIR)/bin
|
BINDIR := $(CURDIR)/bin
|
||||||
|
|
20
README.md
20
README.md
|
@ -54,24 +54,30 @@ $ ./busybox --read-only
|
||||||
### Running with custom commands & args
|
### Running with custom commands & args
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# let's make an nginx binary
|
# let's make an small web server binary
|
||||||
$ make static IMAGE=nginx
|
$ make static IMAGE=r.j3ss.co/hello
|
||||||
Static container created at: ./bin/nginx
|
Static container created at: ./bin/hello
|
||||||
Run with ./bin/nginx
|
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
|
# Let's install my super cool binary for setting up networking in a container
|
||||||
$ go get github.com/jfrazelle/netns
|
$ go get github.com/jfrazelle/netns
|
||||||
|
|
||||||
# now we can add this as a prestart hook
|
# 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
|
# let's get the ip file
|
||||||
$ cat .ip
|
$ cat .ip
|
||||||
172.19.0.10
|
172.19.0.10
|
||||||
|
|
||||||
|
# we can curl it
|
||||||
|
$ curl -sSL $(cat .ip):8080
|
||||||
|
Hello World!
|
||||||
|
|
||||||
Success!
|
Success!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue