diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index ead2014081ef88387b1fc11d7c488fb3ef80fc93..339fe7c40ae404d36a93e4da26f26fe19decfc08 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -49,8 +49,8 @@
   when: (not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]) and (docker_repo_info.repos|length > 0)
 
 - name: Configure docker repository on RedHat/CentOS
-  copy:
-    src: "rh_docker.repo"
+  template:
+    src: "rh_docker.repo.j2"
     dest: "/etc/yum.repos.d/docker.repo"
   when: ansible_distribution in ["CentOS","RedHat"]
 
diff --git a/roles/docker/files/rh_docker.repo b/roles/docker/templates/rh_docker.repo.j2
similarity index 74%
rename from roles/docker/files/rh_docker.repo
rename to roles/docker/templates/rh_docker.repo.j2
index a66294c930bfdb84b3a96a42a158d455f426e114..bc711d7feed00e51d12d07320ab16b046019ddc2 100644
--- a/roles/docker/files/rh_docker.repo
+++ b/roles/docker/templates/rh_docker.repo.j2
@@ -4,3 +4,4 @@ baseurl=https://yum.dockerproject.org/repo/main/centos/7
 enabled=1
 gpgcheck=1
 gpgkey=https://yum.dockerproject.org/gpg
+{% if http_proxy %}proxy={{ http_proxy }}{% endif %}