Repository: Azure/iotedgedev

Issue:
Failed to push to local registry
- iotedgedev Version: 1.0.0rc0
- Python Version: Python2.7 Python3.6 Python3.7
- Pip Version:18.1
- Development machine OS Version: Windows10/Ubuntu18.04/Mac os high sierra 10.13.6
- IoT Edge device OS Version: Windows10/Ubuntu18.04/Mac os high sierra 10.13.6

Steps to Reproduce:
1. iotedgedev new test_solution -m filtermodule -t csharp
2. In .env file, update the CONTAINER_REGISTRY_SERVER with “localhost:5001”
3. Make sure there is no local docker registry in your machine (docker rm -f registry)
4. Run "iotedgedev push"
5. It will throw below error message 1
6. In .env file, update the CONTAINER_REGISTRY_SERVER with “localhost:5000”
7. Run "iotedgedev push"
8. It will throw below error message 2
9. Run "iotedgedev push"
10. It push successfully.

error message 1:
```
INITIALIZING CONTAINER REGISTRY

REGISTRY: localhost:5001
Looking for local 'registry' container
Local 'registry' container not found
Looking for local 'registry' image
Local 'registry' image not found
Pulling 'registry' image
Running registry container

PUSHING DOCKER IMAGE: localhost:5001/filtermodule:0.0.1-amd64
The push refers to repository [localhost:5001/filtermodule]
ERROR: Error: Get http://localhost:5001/v2/: read tcp 127.0.0.1:52290->127.0.0.1:5001: read: connection reset by peer
(py36) v-cheye@ubuntu1804-test10:~/csharp/test_solution$
```

error message 2:
```
INITIALIZING CONTAINER REGISTRY

REGISTRY: localhost:5000
Looking for local 'registry' container
Local 'registry' container not found
Looking for local 'registry' image
Local 'registry' image not found
Pulling 'registry' image
Running registry container

PUSHING DOCKER IMAGE: localhost:5000/filtermodule:0.0.1-amd64
The push refers to repository [localhost:5000/filtermodule]
ERROR: Error: Get http://localhost:5000/v2/: EOF
(py36) v-cheye@ubuntu1804-test10:~/csharp/test_solution$
```

Discussion:

Patch:
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 4121a9a..d2519d0 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -5,20 +5,11 @@
             "name": "Python Module",
             "type": "python",
             "request": "launch",
-            "stopOnEntry": true,
             "module": "iotedgedev.cli",
             "args": [
-                "solution",
-                "new",
-                "test_solution"
+                "push"
             ],
-            "debugOptions": [
-                "RedirectOutput"
-            ],
-            "env": {
-                "DOTENV_FILE": ".env",
-            }
+            "cwd": "${workspaceFolder}/tests/test_solution"
         }
     ]
-}
-        
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4ab12a3..ee1413c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -18,6 +18,7 @@ Please fork, branch and pull-request any changes you'd like to make.
 1. Install **Python 2.7+**, **Python 3.6+**, and **pip**
     - Windows: [Install from Python's website](https://www.python.org/downloads/)
     - Linux: `sudo apt-get install python-pip python3-pip`
+    - macOS: The OpenSSL used by the system built-in Python is old and vulnerable. Please use Python installed with [Homebrew](https://docs.brew.sh/Homebrew-and-Python).
     
 1. Install **[Azure CLI 2.0](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)**
 
diff --git a/iotedgedev/dockercls.py b/iotedgedev/dockercls.py
index 99f1a21..7cae0fd 100644
--- a/iotedgedev/dockercls.py
+++ b/iotedgedev/dockercls.py
@@ -43,7 +43,7 @@ class Docker:
             raise ValueError("You must specific a port for your local registry server. Expected: 'localhost:5000'. Found: " + local_server)
 
         port = parts[1]
-        ports = {'{0}/tcp'.format(port): int(port)}
+        ports = {'5000/tcp': int(port)}
 
         try:
             self.output.info("Looking for local 'registry' container")
diff --git a/iotedgedev/template/deployment.template.json b/iotedgedev/template/deployment.template.json
index 80c1a4b..9e20f5f 100644
--- a/iotedgedev/template/deployment.template.json
+++ b/iotedgedev/template/deployment.template.json
@@ -7,7 +7,8 @@
           "type": "docker",
           "settings": {
             "minDockerVersion": "v1.25",
-            "loggingOptions": ""
+            "loggingOptions": "",
+            "registryCredentials": {}
           }
         },
         "systemModules": {


Test patch:
diff --git a/tests/assets/deployment.template_1.json b/tests/assets/deployment.template_1.json
index 3dc499e..3d74b31 100644
--- a/tests/assets/deployment.template_1.json
+++ b/tests/assets/deployment.template_1.json
@@ -7,7 +7,8 @@
           "type": "docker",
           "settings": {
             "minDockerVersion": "v1.25",
-            "loggingOptions": ""
+            "loggingOptions": "",
+            "registryCredentials": {}
           }
         },
         "systemModules": {
diff --git a/tests/assets/deployment.template_2.json b/tests/assets/deployment.template_2.json
index 50fa67d..e1a4fc9 100644
--- a/tests/assets/deployment.template_2.json
+++ b/tests/assets/deployment.template_2.json
@@ -7,7 +7,8 @@
           "type": "docker",
           "settings": {
             "minDockerVersion": "v1.25",
-            "loggingOptions": ""
+            "loggingOptions": "",
+            "registryCredentials": {}
           }
         },
         "systemModules": {
diff --git a/tests/assets/deployment.template_3.json b/tests/assets/deployment.template_3.json
index 7566fd3..ab7b594 100644
--- a/tests/assets/deployment.template_3.json
+++ b/tests/assets/deployment.template_3.json
@@ -7,7 +7,8 @@
           "type": "docker",
           "settings": {
             "minDockerVersion": "v1.25",
-            "loggingOptions": ""
+            "loggingOptions": "",
+            "registryCredentials": {}
           }
         },
         "systemModules": {
diff --git a/tests/assets/deployment.template_4.json b/tests/assets/deployment.template_4.json
index 9909350..6a8384e 100644
--- a/tests/assets/deployment.template_4.json
+++ b/tests/assets/deployment.template_4.json
@@ -7,7 +7,8 @@
           "type": "docker",
           "settings": {
             "minDockerVersion": "v1.25",
-            "loggingOptions": ""
+            "loggingOptions": "",
+            "registryCredentials": {}
           }
         },
         "systemModules": {