Using the Docker API in remote Ubuntu 16.04

Source: Internet
Author: User
Objective

I built the Php+laravel development environment with Docker on the local Ubuntu machine, but configured the remote PHP interpreter (the PHP interpreter in the Docker container) and the connection docker in the local 2016.3.2 version of Phpstorm API found Unable to connect, Google for a long time found in the UNIX system Docker default to use the socket file/var/run/docker.sock, so in the Phpstorm configuration Docker should be in the API URL This column to enter Unix:///var/run/docker.sock. Of course, besides this, there are other ways. specific steps to edit the Docker host file/lib/systemd/system/docker.service
sudo vi/lib/systemd/system/docker.service modify a line that starts with Execstart
Execstart=/usr/bin/docker daemon-h fd://-H tcp://0.0.0.0:4243 Save modified file Notification Docker service make changes
Systemctl daemon-reload Restart Docker service
sudo service docker restart test can be connected to the Docker API
Curl Http://localhost:4243/version

If the Docker host and the Phpstorm host are not the same machine, then use the ifconfig command to view the Docker host's IP address (such as 192.168.1.68) when configuring Phpstorm on the Docker on the API URL This column should be filled in http://192.168.1.68:4243

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.