mirror of
				https://github.com/willfarrell/docker-crontab.git
				synced 2025-10-30 21:27:18 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			522 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			522 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| set -e
 | |
| 
 | |
| # This file is for testing the logging of docker output #8
 | |
| 
 | |
| LOG_FILE=./jobs.log
 | |
| touch ${LOG_FILE}
 | |
| UUID="xxxxxxxxxxxxxxxxx"
 | |
| 
 | |
| exec > >(read message; echo "${UUID} $(date) [info] $message" | tee -a ${LOG_FILE} )
 | |
| exec 2> >(read message; echo "${UUID} $(date) [error] $message" | tee -a ${LOG_FILE} >&2)
 | |
| 
 | |
| echo "Start"
 | |
| 
 | |
| docker run alpine sh -c 'while :; do echo "ping"; sleep 1; done'
 | |
| # [error] write /dev/stdout: broken pipe
 | |
| # --log-driver syslog <- errors
 | |
| # --log-driver none <- errors
 | |
| 
 | |
| echo "End"
 |