diff --git a/agent/alpine/Dockerfile b/agent/alpine/Dockerfile
index 7c1b62f..904fc98 100644
--- a/agent/alpine/Dockerfile
+++ b/agent/alpine/Dockerfile
@@ -4,6 +4,8 @@ MAINTAINER Alexey Pustovalov <alexey.pustovalov@zabbix.com>
 ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 
 RUN addgroup zabbix && \
@@ -22,6 +24,7 @@ RUN addgroup zabbix && \
             supervisor \
             bash \
             coreutils \
+            netcat-openbsd \
             libssl1.0  && \
     rm -rf /var/cache/apk/*
 
@@ -30,7 +33,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
 
-RUN apk update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk update && \
     apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             alpine-sdk \
             automake \
@@ -60,7 +75,8 @@ RUN apk update && \
     rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
     apk del --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10050/TCP
 
diff --git a/agent/ubuntu/Dockerfile b/agent/ubuntu/Dockerfile
index f2904b0..c77bb3e 100644
--- a/agent/ubuntu/Dockerfile
+++ b/agent/ubuntu/Dockerfile
@@ -4,6 +4,8 @@ MAINTAINER Alexey Pustovalov <alexey.pustovalov@zabbix.com>
 ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
@@ -35,7 +37,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             gcc \
             make \
@@ -75,7 +89,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             subversion 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove && \
     apt-get ${APT_FLAGS_COMMON} clean && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10050/TCP
 
diff --git a/docker-compose_v2_alpine_mysql_local.yaml b/docker-compose_v2_alpine_mysql_local.yaml
index d5e25a8..ce93832 100644
--- a/docker-compose_v2_alpine_mysql_local.yaml
+++ b/docker-compose_v2_alpine_mysql_local.yaml
@@ -1,7 +1,11 @@
 version: '2'
 services:
  zabbix-server:
-  build: ./server-mysql/alpine
+  build:
+   context: ./server-mysql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-server-mysql:alpine-local
   ports:
    - "10051:10051"
@@ -44,7 +48,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-proxy-sqlite3:
-  build: ./proxy-sqlite3/alpine
+  build:
+   context: ./proxy-sqlite3/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-sqlite3:alpine-local
   ports:
    - "10061:10051"
@@ -85,7 +93,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-proxy-mysql:
-  build: ./proxy-mysql/alpine
+  build:
+   context: ./proxy-mysql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-mysql:alpine-local
   ports:
    - "10071:10051"
@@ -127,7 +139,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-web-apache-mysql:
-  build: ./web-apache-mysql/alpine
+  build:
+   context: ./web-apache-mysql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-apache-mysql:alpine-local
   ports:
    - "80:80"
@@ -159,7 +175,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-web-nginx-mysql:
-  build: ./web-nginx-mysql/alpine
+  build:
+   context: ./web-nginx-mysql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-nginx-mysql:alpine-local
   ports:
    - "8081:80"
@@ -191,7 +211,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-agent:
-  build: ./agent/alpine
+  build:
+   context: ./agent/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-agent:alpine-local
   ports:
    - "10050:10050"
@@ -222,7 +246,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-java-gateway:
-  build: ./java-gateway/alpine
+  build:
+   context: ./java-gateway/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-java-gateway:alpine-local
   ports:
    - "10052:10052"
@@ -241,7 +269,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-snmptraps:
-  build: ./snmptraps/ubuntu
+  build:
+   context: ./snmptraps/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-snmptraps:ubuntu-local
   ports:
    - "162:162/udp"
diff --git a/docker-compose_v2_alpine_pgsql_local.yaml b/docker-compose_v2_alpine_pgsql_local.yaml
index 9827042..ebeb4d4 100644
--- a/docker-compose_v2_alpine_pgsql_local.yaml
+++ b/docker-compose_v2_alpine_pgsql_local.yaml
@@ -1,7 +1,11 @@
 version: '2'
 services:
  zabbix-server:
-  build: ./server-pgsql/alpine
+  build:
+   context: ./server-pgsql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-server-pgsql:alpine-local
   ports:
    - "10051:10051"
@@ -44,7 +48,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-proxy-sqlite3:
-  build: ./proxy-sqlite3/alpine
+  build:
+   context: ./proxy-sqlite3/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-sqlite3:alpine-local
   ports:
    - "10061:10051"
@@ -85,7 +93,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-proxy-mysql:
-  build: ./proxy-mysql/alpine
+  build:
+   context: ./proxy-mysql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-mysql:alpine-local
   ports:
    - "10071:10051"
@@ -128,7 +140,11 @@ services:
 
 
  zabbix-web-apache-pgsql:
-  build: ./web-apache-pgsql/alpine
+  build:
+   context: ./web-apache-pgsql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-apache-pgsql:alpine-local
   ports:
    - "80:80"
@@ -160,7 +176,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-web-nginx-pgsql:
-  build: ./web-nginx-pgsql/alpine
+  build:
+   context: ./web-nginx-pgsql/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-nginx-pgsql:alpine-local
   ports:
    - "8081:80"
@@ -193,6 +213,11 @@ services:
 
  zabbix-agent:
   build: ./agent/alpine
+  build:
+   context: ./agent/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-agent:alpine-local
   ports:
    - "10050:10050"
@@ -223,7 +248,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-java-gateway:
-  build: ./java-gateway/alpine
+  build:
+   context: ./java-gateway/alpine
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-java-gateway:alpine-local
   ports:
    - "10052:10052"
@@ -242,7 +271,11 @@ services:
    com.zabbix.os: "alpine"
 
  zabbix-snmptraps:
-  build: ./snmptraps/ubuntu
+  build:
+   context: ./snmptraps/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-snmptraps:ubuntu-local
   ports:
    - "162:162/udp"
diff --git a/docker-compose_v2_ubuntu_mysql_local.yaml b/docker-compose_v2_ubuntu_mysql_local.yaml
index 00a5695..5d3c603 100644
--- a/docker-compose_v2_ubuntu_mysql_local.yaml
+++ b/docker-compose_v2_ubuntu_mysql_local.yaml
@@ -1,7 +1,11 @@
 version: '2'
 services:
  zabbix-server:
-  build: ./server-mysql/ubuntu
+  build:
+   context: ./server-pgsql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-server-mysql:ubuntu-local
   ports:
    - "10051:10051"
@@ -45,7 +49,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-proxy-sqlite3:
-  build: ./proxy-sqlite3/ubuntu
+  build:
+   context: ./proxy-sqlite3/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-sqlite3:ubuntu-local
   ports:
    - "10061:10051"
@@ -86,7 +94,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-proxy-mysql:
-  build: ./proxy-mysql/ubuntu
+  build:
+   context: ./proxy-mysql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-mysql:ubuntu-local
   ports:
    - "10071:10051"
@@ -128,7 +140,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-web-apache-mysql:
-  build: ./web-apache-mysql/ubuntu
+  build:
+   context: ./web-apache-mysql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-apache-mysql:ubuntu-local
   ports:
    - "80:80"
@@ -160,7 +176,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-web-nginx-mysql:
-  build: ./web-nginx-mysql/ubuntu
+  build:
+   context: ./web-nginx-mysql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-nginx-mysql:ubuntu-local
   ports:
    - "8081:80"
@@ -192,7 +212,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-agent:
-  build: ./agent/ubuntu
+  build:
+   context: ./agent/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-agent:ubuntu-local
   ports:
    - "10050:10050"
@@ -223,7 +247,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-java-gateway:
-  build: ./java-gateway/ubuntu
+  build:
+   context: ./java-gateway/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-java-gateway:ubuntu-local
   ports:
    - "10052:10052"
@@ -242,7 +270,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-snmptraps:
-  build: ./snmptraps/ubuntu
+  build:
+   context: ./snmptraps/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-snmptraps:ubuntu-local
   ports:
    - "162:162/udp"
diff --git a/docker-compose_v2_ubuntu_pgsql_local.yaml b/docker-compose_v2_ubuntu_pgsql_local.yaml
index bd68a59..0047793 100644
--- a/docker-compose_v2_ubuntu_pgsql_local.yaml
+++ b/docker-compose_v2_ubuntu_pgsql_local.yaml
@@ -1,7 +1,11 @@
 version: '2'
 services:
  zabbix-server:
-  build: ./server-pgsql/ubuntu
+  build:
+   context: ./server-pgsql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-server-pgsql:ubuntu-local
   ports:
    - "10051:10051"
@@ -44,7 +48,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-proxy-sqlite3:
-  build: ./proxy-sqlite3/ubuntu
+  build:
+   context: ./proxy-sqlite3/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-sqlite3:ubuntu-local
   ports:
    - "10061:10051"
@@ -85,7 +93,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-proxy-mysql:
-  build: ./proxy-mysql/ubuntu
+  build:
+   context: ./proxy-mysql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-proxy-mysql:ubuntu-local
   ports:
    - "10071:10051"
@@ -127,7 +139,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-web-apache-pgsql:
-  build: ./web-apache-pgsql/ubuntu
+  build:
+   context: ./web-apache-pgsql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-apache-pgsql:ubuntu-local
   ports:
    - "80:80"
@@ -159,7 +175,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-web-nginx-pgsql:
-  build: ./web-nginx-pgsql/ubuntu
+  build:
+   context: ./web-nginx-pgsql/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-web-nginx-pgsql:ubuntu-local
   ports:
    - "8081:80"
@@ -191,7 +211,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-agent:
-  build: ./agent/ubuntu
+  build:
+   context: ./agent/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-agent:ubuntu-local
   ports:
    - "10050:10050"
@@ -222,7 +246,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-java-gateway:
-  build: ./java-gateway/ubuntu
+  build:
+   context: ./java-gateway/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-java-gateway:ubuntu-local
   ports:
    - "10052:10052"
@@ -241,7 +269,11 @@ services:
    com.zabbix.os: "ubuntu"
 
  zabbix-snmptraps:
-  build: ./snmptraps/ubuntu
+  build:
+   context: ./snmptraps/ubuntu
+   args:
+    - http_proxy=${http_proxy}
+    - https_proxy=${https_proxy}
   image: zabbix-snmptraps:ubuntu-local
   ports:
    - "162:162/udp"
diff --git a/java-gateway/alpine/Dockerfile b/java-gateway/alpine/Dockerfile
index c7a4044..d8d0aa0 100644
--- a/java-gateway/alpine/Dockerfile
+++ b/java-gateway/alpine/Dockerfile
@@ -4,6 +4,8 @@ MAINTAINER Alexey Pustovalov <alexey.pustovalov@zabbix.com>
 ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 
 RUN addgroup zabbix && \
@@ -18,6 +20,7 @@ RUN addgroup zabbix && \
     apk add ${APK_FLAGS_COMMON} \
             supervisor \
             bash \
+            netcat-openbsd \
             openjdk8-jre-base && \
     rm -rf /var/cache/apk/*
 
@@ -26,7 +29,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             alpine-sdk \
             coreutils \
             automake \
@@ -56,7 +71,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10052/TCP
 
diff --git a/java-gateway/ubuntu/Dockerfile b/java-gateway/ubuntu/Dockerfile
index e4c7066..d71496f 100644
--- a/java-gateway/ubuntu/Dockerfile
+++ b/java-gateway/ubuntu/Dockerfile
@@ -4,6 +4,8 @@ MAINTAINER Alexey Pustovalov <alexey.pustovalov@zabbix.com>
 ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
@@ -32,7 +34,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             gcc \
             make \
@@ -71,7 +85,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             subversion 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove && \
     apt-get ${APT_FLAGS_COMMON} clean && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10052/TCP
 
diff --git a/proxy-mysql/alpine/Dockerfile b/proxy-mysql/alpine/Dockerfile
index ec352f7..6622667 100644
--- a/proxy-mysql/alpine/Dockerfile
+++ b/proxy-mysql/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -40,6 +42,7 @@ RUN addgroup zabbix && \
             libldap \
             libcurl \
             openipmi-libs \
+            netcat-openbsd \
             libssh2 && \
     rm -rf /var/cache/apk/*
 
@@ -48,7 +51,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             alpine-sdk \
             coreutils \
             automake \
@@ -97,7 +112,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/proxy-mysql/ubuntu/Dockerfile b/proxy-mysql/ubuntu/Dockerfile
index 853be28..f83e0e8 100644
--- a/proxy-mysql/ubuntu/Dockerfile
+++ b/proxy-mysql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -53,7 +55,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             gcc \
             make \
@@ -119,7 +133,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             automake \
             subversion 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove 1>/dev/null && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/proxy-sqlite3/alpine/Dockerfile b/proxy-sqlite3/alpine/Dockerfile
index 7e85398..e98cc11 100644
--- a/proxy-sqlite3/alpine/Dockerfile
+++ b/proxy-sqlite3/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=sqlite3
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -36,6 +38,7 @@ RUN addgroup zabbix && \
             libldap \
             libcurl \
             openipmi-libs \
+            netcat-openbsd \
             libssh2 && \
     rm -rf /var/cache/apk/*
 
@@ -44,7 +47,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             alpine-sdk \
             coreutils \
             automake \
@@ -92,7 +107,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/proxy-sqlite3/ubuntu/Dockerfile b/proxy-sqlite3/ubuntu/Dockerfile
index ea988b5..b0dd899 100644
--- a/proxy-sqlite3/ubuntu/Dockerfile
+++ b/proxy-sqlite3/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=sqlite3
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -51,7 +53,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             gcc \
             make \
@@ -116,7 +130,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             libxml2-dev \
             subversion 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove 1>/dev/null && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/server-mysql/alpine/Dockerfile b/server-mysql/alpine/Dockerfile
index 0227562..dfc6ba7 100644
--- a/server-mysql/alpine/Dockerfile
+++ b/server-mysql/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -41,6 +43,7 @@ RUN addgroup zabbix && \
             libldap \
             libcurl \
             openipmi-libs \
+            netcat-openbsd \
             libssh2 && \
     rm -rf /var/cache/apk/*
 
@@ -49,7 +52,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             alpine-sdk \
             coreutils \
             automake \
@@ -100,7 +115,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/server-mysql/ubuntu/Dockerfile b/server-mysql/ubuntu/Dockerfile
index e864c05..e75c353 100644
--- a/server-mysql/ubuntu/Dockerfile
+++ b/server-mysql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -54,7 +56,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             gcc \
             make \
@@ -122,7 +136,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             libxml2-dev \
             subversion 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove 1>/dev/null && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP
 
diff --git a/server-pgsql/alpine/Dockerfile b/server-pgsql/alpine/Dockerfile
index 896f0e1..927ae96 100644
--- a/server-pgsql/alpine/Dockerfile
+++ b/server-pgsql/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=postgresql
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -41,6 +43,7 @@ RUN addgroup zabbix && \
             libldap \
             libcurl \
             openipmi-libs \
+            netcat-openbsd \
             libssh2 && \
     rm -rf /var/cache/apk/*
 
@@ -49,7 +52,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             alpine-sdk \
             coreutils \
             automake \
@@ -100,7 +115,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/server-pgsql/ubuntu/Dockerfile b/server-pgsql/ubuntu/Dockerfile
index c0f044c..cb0620d 100644
--- a/server-pgsql/ubuntu/Dockerfile
+++ b/server-pgsql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=postgresql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
 
@@ -54,7 +56,19 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.4
 ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
 ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             gcc \
             make \
@@ -122,7 +136,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             libxml2-dev \
             subversion 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove 1>/dev/null && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 10051/TCP 162/UDP
 
diff --git a/snmptraps/ubuntu/Dockerfile b/snmptraps/ubuntu/Dockerfile
index cc6ce35..80f94ee 100644
--- a/snmptraps/ubuntu/Dockerfile
+++ b/snmptraps/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 ADD snmptrapfmt_1.14+nmu1ubuntu2_amd64.deb /tmp/
diff --git a/web-apache-mysql/alpine/Dockerfile b/web-apache-mysql/alpine/Dockerfile
index 157d785..1717be8 100644
--- a/web-apache-mysql/alpine/Dockerfile
+++ b/web-apache-mysql/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 
 RUN addgroup zabbix && \
@@ -34,6 +36,7 @@ RUN addgroup zabbix && \
             php5-xmlreader \
             php5-ldap \
             php5-json \
+            netcat-openbsd \
             ttf-dejavu && \
     rm -rf /var/cache/apk/*
 
@@ -44,7 +47,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             coreutils \
             gettext \
             subversion && \
@@ -60,7 +75,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-apache-mysql/ubuntu/Dockerfile b/web-apache-mysql/ubuntu/Dockerfile
index 85bfb75..b1c4897 100644
--- a/web-apache-mysql/ubuntu/Dockerfile
+++ b/web-apache-mysql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
@@ -43,7 +45,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             subversion \
             patch \
@@ -79,7 +93,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             gettext 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove && \
     apt-get ${APT_FLAGS_COMMON} clean && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-apache-pgsql/alpine/Dockerfile b/web-apache-pgsql/alpine/Dockerfile
index 2d0bcd7..1841f39 100644
--- a/web-apache-pgsql/alpine/Dockerfile
+++ b/web-apache-pgsql/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=postgresql
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 
 RUN addgroup zabbix && \
@@ -33,6 +35,7 @@ RUN addgroup zabbix && \
             php5-xmlreader \
             php5-ldap \
             php5-json \
+            netcat-openbsd \
             ttf-dejavu && \
     rm -rf /var/cache/apk/*
 
@@ -43,7 +46,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             coreutils \
             gettext \
             subversion && \
@@ -59,7 +74,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-apache-pgsql/ubuntu/Dockerfile b/web-apache-pgsql/ubuntu/Dockerfile
index 48487af..0efc0de 100644
--- a/web-apache-pgsql/ubuntu/Dockerfile
+++ b/web-apache-pgsql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=postgresql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
@@ -43,7 +45,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             subversion \
             patch \
@@ -79,7 +93,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             gettext 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove && \
     apt-get ${APT_FLAGS_COMMON} clean && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-nginx-mysql/alpine/Dockerfile b/web-nginx-mysql/alpine/Dockerfile
index a30da62..8795d21 100644
--- a/web-nginx-mysql/alpine/Dockerfile
+++ b/web-nginx-mysql/alpine/Dockerfile
@@ -4,6 +4,8 @@ MAINTAINER Alexey Pustovalov <alexey.pustovalov@zabbix.com>
 ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
+ARG http_proxy
+ARG https_proxy
 ARG DB_TYPE=mysql
 ENV TERM=xterm
 
@@ -33,6 +35,7 @@ RUN addgroup zabbix && \
             php5-xmlreader \
             php5-ldap \
             php5-json \
+            netcat-openbsd \
             ttf-dejavu && \
     rm -rf /var/cache/apk/*
 
@@ -43,7 +46,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             coreutils \
             gettext \
             subversion && \
@@ -59,7 +74,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-nginx-mysql/ubuntu/Dockerfile b/web-nginx-mysql/ubuntu/Dockerfile
index f7bc480..d6c7c8e 100644
--- a/web-nginx-mysql/ubuntu/Dockerfile
+++ b/web-nginx-mysql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=mysql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
@@ -50,7 +52,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             subversion \
             patch \
@@ -86,7 +100,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             gettext 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove && \
     apt-get ${APT_FLAGS_COMMON} clean && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-nginx-pgsql/alpine/Dockerfile b/web-nginx-pgsql/alpine/Dockerfile
index b4e4446..21aaca1 100644
--- a/web-nginx-pgsql/alpine/Dockerfile
+++ b/web-nginx-pgsql/alpine/Dockerfile
@@ -5,6 +5,8 @@ ARG APK_FLAGS_COMMON="-q"
 ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
 ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
 ARG DB_TYPE=postgresql
+ARG http_proxy
+ARG https_proxy
 ENV TERM=xterm
 
 RUN addgroup zabbix && \
@@ -32,6 +34,7 @@ RUN addgroup zabbix && \
             php5-xmlreader \
             php5-ldap \
             php5-json \
+            netcat-openbsd \
             ttf-dejavu && \
     rm -rf /var/cache/apk/*
 
@@ -42,7 +45,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
             coreutils \
             gettext \
             subversion && \
@@ -58,7 +73,8 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
     ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \
     apk del ${APK_FLAGS_COMMON} --purge \
             build-dependencies && \
-    rm -rf /var/cache/apk/*
+    rm -rf /var/cache/apk/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
diff --git a/web-nginx-pgsql/ubuntu/Dockerfile b/web-nginx-pgsql/ubuntu/Dockerfile
index a40699f..115e3b0 100644
--- a/web-nginx-pgsql/ubuntu/Dockerfile
+++ b/web-nginx-pgsql/ubuntu/Dockerfile
@@ -5,6 +5,8 @@ ARG APT_FLAGS_COMMON="-qq -y"
 ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
 ARG DB_TYPE=postgresql
+ARG http_proxy
+ARG https_proxy=$http_proxy
 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
 
 RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
@@ -50,7 +52,19 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
 
 ADD conf/tmp/font-config /tmp/font-config
 
-RUN apt-get ${APT_FLAGS_COMMON} update && \
+RUN [ $https_proxy ] && { \
+      PXY_HOST=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      PXY_PORT=$( echo $https_proxy | sed -rn 's%^([^:]+://)?([^/:]+)(:([0-9]+))?.*%\4%p' ) ; \
+      SVN_PROXY=${PXY_HOST}:${PXY_PORT:-3128} ; \
+      SVN_HOST=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\2%p' ) ; \
+      SVN_PORT=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?.*%\3%p' ) ; \
+      SVN_PORT=${SVN_PORT:-3690} ; \
+      ZBX_SOURCES=$( echo $ZBX_SOURCES | sed -rn 's%^([^:]+://)?([^/:]+)(:[0-9]+)?(.*)%\1127.0.0.1\4%p' ) ; \
+      SVN_PIPE=$( mktemp -ut svn-proxy.XXXXXXXXXX ) ; \
+      mkfifo $SVN_PIPE ; \
+      nc -klw3 3690 < $SVN_PIPE | nc -X connect -x "$SVN_PROXY" "$SVN_HOST" "$SVN_PORT" > $SVN_PIPE & \
+    } ; \
+    apt-get ${APT_FLAGS_COMMON} update && \
     apt-get ${APT_FLAGS_DEV} install \
             subversion \
             patch \
@@ -86,7 +100,8 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
             gettext 1>/dev/null && \
     apt-get ${APT_FLAGS_COMMON} autoremove && \
     apt-get ${APT_FLAGS_COMMON} clean && \
-    rm -rf /var/lib/apt/lists/*
+    rm -rf /var/lib/apt/lists/* && \
+    [ -e $SVN_PIPE ] && rm -f $SVN_PIPE
 
 EXPOSE 80/TCP 443/TCP
 
