Commit e03df513 authored by Gergely Csatari's avatar Gergely Csatari
Browse files

Making docker build work behind http proxy

As some of us are working behind corporate firewalls
and some of us are not the docker build and execution
should work in both proxy and non proxy environemnt.
This chnage adds this support.

Note: npm gives a warning when no proxy is used. I could not
figure out any good way to work this around. Any comments are welcome.

Change-Id: Ic9afb1c83fbe33fd2c78d913d3c7c8e10200a2b4
Signed-off-by: Gergely Csatari's avatarGergely Csatari <>
parent 25b19d61
......@@ -3,10 +3,18 @@
FROM alpine:3.6
#ENV http_proxy
#ENV https_proxy something
#ENV no_proxy
RUN env
RUN apk update
RUN apk add bash
RUN apk add nodejs
RUN apk add nodejs-npm
RUN npm config set proxy $http_proxy
RUN npm install -g swagger-tools@0.10.3
RUN npm install -g json-refs@3.0.2
RUN npm install -g yamljs@0.3.0
......@@ -2,4 +2,24 @@
# Copyright ETSI 2017
# See:
docker build -t openapivalidator .
\ No newline at end of file
#set -x
proxy = ""
if [[ ! -v http_proxy ]]; then
echo "http_proxy is not set"
elif [[ -z "$http_proxy" ]]; then
echo "http_proxy is empty"
echo "http_proxy is set to $http_proxy"
if [[ $http_proxy =~ ^http:\/\/[0-9] ]]; then
echo "starts with http"
elif [[ $http_proxy =~ ^[0-9] ]]; then
echo "starts with number"
echo "Proxy set to $proxy"
docker build --build-arg http_proxy=$proxy -t openapivalidator .
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment