forked from AliyunContainerService/log-pilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chenqz1987
committed
Dec 26, 2017
1 parent
cd38d53
commit 1ab6c4b
Showing
7 changed files
with
112 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Jizhong Jiang <[email protected]> (@jzwlqx) | ||
Bingshen Wang <[email protected]> (@BSWANG) | ||
Linhua Tan <[email protected]> (@toolchainX) | ||
|
||
Quanzhao Chen <[email protected]> (@chenqz1987) |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
busybox: | ||
image: busybox | ||
restart: always | ||
labels: | ||
aliyun.logs.busybox: stdout | ||
aliyun.logs.busybox.tags: app=busybox,stage=test | ||
command: ['ping', 'localhost'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '2' | ||
services: | ||
pilot: | ||
image: pilot:latest | ||
privileged: true | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /etc/localtime:/etc/localtime | ||
- /:/host | ||
environment: | ||
FLUENTD_OUTPUT: file | ||
FILE_PATH: /host/tmp/logs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
cd $(dirname $0) | ||
|
||
green(){ | ||
echo -e "\033[0;32m$*\033[0m" | ||
} | ||
|
||
blue(){ | ||
echo -e "\033[0;34m$*\033[0m" | ||
} | ||
|
||
blue "Cleanup" | ||
docker-compose -p quickstart -f file.yml down | ||
|
||
blue "Starting file+fluentd-pilot" | ||
docker-compose -p quickstart -f file.yml up -d | ||
|
||
host=127.0.0.1 | ||
|
||
if [ -n "DOCKER_HOST" ]; then | ||
host=$(echo $DOCKER_HOST|sed -e 's:^.*//::' -e 's/:.*$//') | ||
fi | ||
|
||
if [ -z "$host" ]; then | ||
echo "Could not detect docker host." | ||
fi | ||
|
||
blue "\nCleanup" | ||
#docker-compose -p busybox -f busybox.yml down | ||
docker-compose -p tomcat -f tomcat.yml down | ||
|
||
blue "Starting application" | ||
#docker-compose -p busybox -f busybox.yml up -d | ||
docker-compose -p tomcat -f tomcat.yml up -d | ||
|
||
pwd=$(pwd) | ||
project=$(basename $pwd) | ||
|
||
echo | ||
green "Start successfully!" | ||
echo | ||
|
||
cat << EOF | ||
Now enter the FILE_PATH and after 1 minutes you can see any logs. | ||
EOF |