Unable to connect to GITHUB during Docker Instance cloud-init

Posted February 28, 2015 3.5k views

x-post comment from:
An Introduction to Droplet Metadata

I’m using the cloud-init to initialize my docker instance. However, I’m finding that I can’t seem to make a network connection to during init.

My script is:


git clone

cd centos-node-hello

docker build -t centos-node-hello .
docker run -p 80:8080 -d centos-node-hello

During start up, the logs shows:

fatal: unable to access '': Failed to connect to port 443: Connection timed out

Of course, after that everything fails since I didn’t get the code.

Now, if I let the droplet finish it’s startup sequence and log in, I can re-run the script manually and the git clone works just fine. The docker image gets created and starts and my app is running.

It almost appears that the network hasn’t fully set up when the cloud-init executes.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

I attempted twice to replicate this issue but using your cloud-init script exactly as you pasted it on a newly created droplet based on our docker image completed without any issue on both attempts. It is possible that a temporary network issue caused the problem that you saw but your script, as pasted appears to work perfectly.