-
-
Save scottferg/15499969407222039a67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build | |
sudo docker build -t pokerap . | |
# run | |
sudo docker run -v /dev/log:/dev/log pokerap /go/bin/gokerap | |
# check syslog | |
sudo tail /var/log/syslog | |
# here are the cool lines I like | |
Oct 16 17:58:12 vagrant-ubuntu-trusty-64 go_log[1]: 2014/10/16 17:58:12 Docker is logging on the host machine. | |
Oct 16 17:58:12 vagrant-ubuntu-trusty-64 go_log[1]: 2014/10/16 17:58:12 GO LOGGING | |
#They're cool because of main.go | |
func main() { | |
logwriter, e := syslog.New(syslog.LOG_NOTICE, "go_log") | |
if e == nil { | |
fmt.Println("Hey Syslog") | |
log.SetOutput(logwriter) | |
} | |
log.Println("Docker is logging on the host machine.") | |
log.Print("GO LOGGING") | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "Runs the Zuul chat server" | |
start on local-filesystems | |
stop on deconfiguring-networking | |
pre-start script | |
docker kill zuul || true | |
docker rm zuul || true | |
end script | |
script | |
. /var/lib/cloud/instance/user-data.txt | |
exec docker run --rm -v /dev/log:/dev/log -p 8080:8080 --name zuul docker.vokalinteractive.com/zuul | |
end script | |
pre-stop script | |
docker stop zuul | |
end script | |
respawn | |
respawn limit 10 90 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment