Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker compose logs container stdout

init-app.sh:

#!/usr/bin/env sh

# Exit script immediately if a command exits with a non-zero status.
set -e

# Install and configure app
[...]

# Start app
exec ./app
The above configuration works, but outputs only to stdout.

Modification #1 (last line of init script):

# Start app and log output to file
exec ./app >> "/app/log.txt" 2>&1
This configuration works also, logging the output to a file, but not to stdout.

Modification #2 (last line of init script):

# Start app and log output to both a file and stdout
exec ./app 2>&1 | tee -a "/app/log.txt"
Comment

PREVIOUS NEXT
Code Example
Shell :: rem command 
Shell :: read -r bash from file 
Shell :: nmap script location in kali 
Shell :: install albert search ubuntu 
Shell :: powershell invert 
Shell :: source code not available.. 
Shell :: Grep check 
Shell :: command to reload a system service 
Shell :: how to extract sequential files multiple zip files at once 
Shell :: Composer Terminal Valet 
Shell :: scapy tutorials for mac 
Shell :: command to install and initialize React Helmet 
Shell :: reuse branch name 
Shell :: how to git ignore 
Shell :: create public key linux 
Shell :: flutter update packages command 
Shell :: git unstage 
Shell :: grep search match 
Shell :: what is shell in linux 
Shell :: docker-compose prevent exit 
Shell :: run artisan queue --once loop 
Shell :: Switching the namespaces using kubectl commands 
Shell :: how to I paste in gitbash windows 
Shell :: !g how to uninstall tor linux installed from source code 
Shell :: evans cycles womens gravel bikes 
Shell :: manueldeveloper github 
Php :: drupal 8 show php errors settings.php 
Php :: php add 0 before number 
Php :: php uppercase 
Php :: composer laravel ui 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =