search

Home  >  Q&A  >  body text

请问,jenkins安装了docker插件,请问怎么查看远程服务器上的docker URL?

1.docker安装在远程服务器,jenkins安装在本地机,从jenkins中下载了一些docker plugin,但是在配置远程docker URL的时候失败,测试的时候无法连接上去。
2.

伊谢尔伦伊谢尔伦2844 days ago735

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-24 09:15:22

    Docker URL should contain the port, for example:

    http://114.215.138.254:2375

    Here 2375 is the tcp port that docker monitors, which is not open by default. You need to set it up like this (taking ubuntu as an example)

    1. Modify docker configuration file

    sudo vim /etc/default/docker

    Add the following:

    DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"

    2. Restart docker

    sudo restart docker

    or

    sudo service docker restart

    2. View docker port

    sudo netstat -ltnp | grep docker
    tcp6       0      0 :::2375                 :::*                    LISTEN      6112/docker 

    Warning: It is very unsafe to open the tcp port that docker listens to, and you have exposed the IP address of the host, please set up a firewall!

    reply
    0
  • Cancelreply