简体   繁体   English

IBM / secure-gateway-client docker与--F(acl文件)选项一起运行

[英]IBM/secure-gateway-client docker run with the --F (acl file) option

I have been reading the documentation and still cannot work out how to get the IBM/Secure-Gateway-client to run with an ACL file option within docker. 我一直在阅读文档,但仍无法弄清楚如何使IBM / Secure-Gateway-client在docker中与ACL文件选项一起运行。

I have pulled the client docker image, and have been using the following syntax: 我已拉出客户端泊坞窗映像,并一直使用以下语法:

bash -c 'nohup docker run ibmcom/secure-gateway-client --F aclfile.txt xxx_stage_ng  > tmp/run_sgc.log 2>&1 &'

All I get in the log is the following: 我得到的日志如下:

[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

I have given the full path to the file, no path (as above) and any interim option I can think of. 我已经给出了文件的完整路径,没有给出任何路径(如上所述)以及我能想到的任何临时选项。 The container runs, but not with the options I want to specify in the ACL file. 容器运行,但是没有运行我要在ACL文件中指定的选项。

This is what I did: 这是我所做的:

1) Created a Dockerfile to include the aclfile.txt 1)创建了一个包含aclfile.txt的Dockerfile

FROM ibmcom/secure-gateway-client
ADD aclfile.txt /tmp/aclfile.txt

2) Built a new docker image 2)建立一个新的docker映像

docker build -t ads-secure-gateway-client .

3) Run new docker image (need to specify -t and -i options, otherwise would get error file not found): 3)运行新的docker映像(需要指定-t和-i选项,否则将找不到错误文件):

docker run -t -i ads-secure-gateway-client  --F /tmp/aclfile.txt

4) Got the following output: 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

I hope that helps. 希望对您有所帮助。

To use the interactive 'cp' support in docker from your host to the docker instance you must be at docker 1.8.0. 要在Docker中使用从主机到Docker实例的交互式'cp'支持,您必须位于docker 1.8.0。 You can check this using: 您可以使用以下方法进行检查:

docker --version

Once you have done this, your version should display as follows. 完成此操作后,您的版本应显示如下。 It is recommended that you allow docker to run as non-root user, so run the command that is suggested after you have upgraded you engine to 1.8.0 or 1.8.2. 建议您允许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

Then to push out your acl file list to the docker image follow these steps: 然后将您的acl文件列表推送到docker映像中,请按照以下步骤操作:

  1. Run 'docker ps' command to find your container ID 运行'docker ps'命令以找到您的容器ID

    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 764aadce386b ibmcom/secure-gateway-client "node lib/secgwclient" 27 seconds ago Up 26 seconds condescending_nobel 容器ID图像命令创建的状态端口名称764aadce386b ibmcom / secure-gateway-client“ node lib / secgwclient” 27秒前向上26秒condescending_nobel

  2. Copy your acl.list using the 'docker cp' command using either the container ID or name: 使用容器ID或名称使用'docker cp'命令复制acl.list:

    docker cp 01_client.list 764aadce386b:/root/01_client.list 泊坞窗cp 01_client.list 764aadce386b:/root/01_client.list

  3. Next, in the secure gateway client running in docker: 接下来,在docker中运行的安全网关客户端中:

    cli> F /root/01_client.list 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 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM