我有一个应该在docker swarm上运行分布式orientdb服务器的管道。在本地,一切运行良好,我可以看到docker容器的标准输出。但是,当我运行管道时,docker容器的标准输出未显示在Jenkins的控制台输出中。
(之前已复制文件/tmp/schema.json和/tmp/scripts/commands_plocal.txt)
本地:
docker exec ${POD_1} /bin/sh -c './bin/console.sh /tmp/scripts/commands_plocal.txt'
给予:
OrientDB console v.3.0.3 - Veloce (build c2e522065cf081ecd9af5d631866528a1bcd8183, branch develop) https://www.orientdb.com
Type 'help' to display all the supported commands.
echo = TRUE
orientdb> connect remote:localhost root password
OK
orientdb {server=remote:localhost}> create database plocal:/orientdb/databases/test
Creating database [plocal:/orientdb/databases/test] using the storage type [PLOCAL]...
Database created successfully.
Current database is: plocal:/orientdb/databases/test
orientdb {db=test}> import database /tmp/schema.json
Importing database database /tmp/schema.json...
Started import of database 'plocal:/orientdb/databases/test' from /tmp/schema.json...
Non merge mode (-merge=false): removing all default non security classes
- Class E was removed.
- Class OPolygon was removed.
- Class OGeometryCollection was removed.
- Class OPoint was removed.
- Class OMultiPoint was removed.
- Class OMultiLineString was removed.
- Class OFunction was removed.
- Class ORectangle was removed.
- Class OMultiPolygon was removed.
- Class V was removed.
- Class OLineString was removed.
- Class ORestricted was removed.
- Class OTriggered was removed.
- Class OSequence was removed.
- Class OSchedule was removed.
- Class OShape was removed.
Removed 16 classes.
Importing database info...OK
Importing clusters...
- Creating cluster 'internal'...OK, assigned id=0
- Creating cluster 'default'...OK, assigned id=3
- Creating cluster 'orole'...OK, assigned id=4
- Creating cluster 'ouser'...OK, assigned id=5
- Creating cluster 'ofunction'...OK, assigned id=6
- Creating cluster 'osequence'...OK, assigned id=7
- Creating cluster 'oschedule'...OK, assigned id=8
- Creating cluster 'v'...OK, assigned id=9
- Creating cluster 'v_1'...OK, assigned id=10
- Creating cluster 'v_2'...OK, assigned id=11
- Creating cluster 'v_3'...OK, assigned id=12
- Creating cluster 'v_4'...OK, assigned id=13
...
我尝试将标准输出重定向到文件,然后复制并读取它,但是文件为空。
docker exec ${POD_1} /bin/sh -c './bin/console.sh /tmp/scripts/commands_plocal.txt > /tmp/import.txt'
docker cp ${POD_1}:/tmp/import.txt .
cat import.txt
commands_plocal.txt
SET echo TRUE
connect remote:localhost root password
create database plocal:/orientdb/databases/test
import database /tmp/schema.json
知道我还能看到标准输出吗?