我一直在阅读文档,但仍然无法解决如何使用docker中的ACL文件选项运行IBM / Secure-Gateway-client。
我已经提取了客户端docker镜像,并且一直使用以下语法:
bash -c 'nohup docker run ibmcom/secure-gateway-client --F aclfile.txt xxx_stage_ng > tmp/run_sgc.log 2>&1 &'
我在日志中的所有内容如下:
[2015-09-30 11:30:41.764] [ERROR] An exception occurred reading or processing the ACL file, error is Error: ENOENT, no such file or directory 'aclfile.txt'
[2015-09-30 11:30:41.764] [WARN] The ACL has been set to DENY ALL until this is fixed.
[2015-09-30 11:30:43.779] [INFO] The Secure Gateway tunnel is connected
我已经给出了文件的完整路径,没有路径(如上所述)以及我能想到的任何临时选项。容器运行,但没有我想在ACL文件中指定的选项。
答案 0 :(得分:1)
这就是我所做的:
1)创建了一个Dockerfile以包含aclfile.txt
FROM ibmcom/secure-gateway-client
ADD aclfile.txt /tmp/aclfile.txt
2)建立一个新的泊坞窗图像
docker build -t ads-secure-gateway-client .
3)运行新的docker镜像(需要指定-t和-i选项,否则会收到错误文件):
docker run -t -i ads-secure-gateway-client --F /tmp/aclfile.txt
4)得到以下输出:
[2015-09-30 16:50:32.084] [INFO] The current access control list is being reset and replaced by the user provided batch file: /tmp/aclfile.txt
[2015-09-30 16:50:32.086] [INFO] The ACL batch file process accepts acl allow :8000
[2015-09-30 16:50:32.087] [INFO] The ACL batch file process accepts acl deny localhost:22
我希望有所帮助。
答案 1 :(得分:0)
要使用Docker中从主机到docker实例的交互式“cp”支持,您必须位于docker 1.8.0。您可以使用以下方式检查:
docker --version
完成此操作后,您的版本应显示如下。建议您允许docker以非root用户身份运行,因此请在将引擎升级到1.8.0或1.8.2后运行建议的命令。
Client:
Version: 1.8.2
API version: 1.20
Go version: go1.4.2
Git commit: 0a8c2e3
Built: Thu Sep 10 19:21:21 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.8.2
API version: 1.20
Go version: go1.4.2
Git commit: 0a8c2e3
Built: Thu Sep 10 19:21:21 UTC 2015
OS/Arch: linux/amd64
然后将您的acl文件列表推送到docker镜像,请按照以下步骤操作:
运行'docker ps'命令查找容器ID
集装箱ID图像命令创建状态端口名称 764aadce386b ibmcom / secure-gateway-client“node lib / secgwclient”27秒前26秒condescending_nobel
使用容器ID或名称使用'docker cp'命令复制您的acl.list:
docker cp 01_client.list 764aadce386b:/root/01_client.list
接下来,在docker中运行的安全网关客户端:
CLI> F /root/01_client.list
[2015-10-01 08:12:30.091] [INFO] The current access control list is being reset and replaced by the user provided batch file: /root/01_client.list
[2015-10-01 08:12:30.093] [INFO] The ACL batch file process accepts acl allow 127.0.0.1:27017
[2015-10-01 08:12:30.094] [INFO] The ACL batch file process accepts acl allow 127.0.0.1:22