Skip to content

Instantly share code, notes, and snippets.

@kian
Last active October 30, 2015 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kian/b094f51d92fc69d13a80 to your computer and use it in GitHub Desktop.
Save kian/b094f51d92fc69d13a80 to your computer and use it in GitHub Desktop.
###
### start nginx container with syslog driver
###
[ec2-user@ip-172-31-48-33 ~]$ sudo docker run -d --name testing2 -P --log-driver=syslog nginx
eef985214f466aaa84c4d969c8843c00ff13e38ecbf4377519c1a15290e6a4d0
[ec2-user@ip-172-31-48-33 ~]$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eef985214f46 nginx "nginx -g 'daemon of 7 seconds ago Up 6 seconds 0.0.0.0:32770->80/tcp, 0.0.0.0:32769->443/tcp testing2
###
### request something from nginx so it creates a log entry
###
[ec2-user@ip-172-31-48-33 ~]$ curl http://localhost:32770/
<!DOCTYPE html>
<html>
<head>
....
###
### observe /var/log/messages on the host
###
Oct 29 23:41:38 ip-172-31-48-33 docker/eef985214f46[2526]: 172.17.42.1 - - [29/Oct/2015:23:41:38 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.40.0" "-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment