aboutsummaryrefslogtreecommitdiffstats
path: root/fuel/build/docker/Dockerfile
diff options
context:
space:
mode:
authorStefan K. Berg <stefan.k.berg@ericsson.com>2015-10-19 16:52:34 +0200
committerStefan Berg <stefan.k.berg@ericsson.com>2015-10-27 14:17:41 +0000
commit0f15359fa40d3ec89ee2ca26edece503e0205613 (patch)
tree71c60720ba05d89ee87f5da4d1a419f9dd44a65d /fuel/build/docker/Dockerfile
parentc2a30637d07c9d6690ff24af9e76cab089135850 (diff)
Support for building Fuel behind a http proxy
The build system is now able to work also behind a traditional web proxy setup if the http_proxy, https_proxy and (if needed) no_proxy environment variables has been set prior to invoking make. This is a joint work by Gillian Dunne <gillian.dunne@intel.com> and Stefan Berg <stefan.k.berg@ericsson.com>. Verification so far has been with a mock setup, placing the build machine behind a Squid proxy and blocking outgoing traffic not going through the proxy by firewall rules. The following environment variables was set in the host for these tests: RSYNC_PROXY=10.0.0.1:8888 http_proxy=http://10.0.0.1:8888 https_proxy=http://10.0.0.1:8888 no_proxy=localhost,127.0.0.1,.consultron.com,.sock *** IMPORTANT NOTE ABOUT THE HOST PROXY SETTINGS *** The build system will make use the following proxy environment variables: http_proxy: https_proxy no_proxy RSYNC_PROXY RSYNC_CONNECT_PROG During the build phase, a local Ubuntu package repository is fetched from upstream in order to be added to the OPNFV Fuel ISO and for parts of this process rsync is used. This will require that either RSYNC_PROXY is set according to the format "<proxy host>:<proxy port>" and that the proxy indicated indeed allows rsync traffic *or* that RSYNC_CONNECT_PROG is set to use an alternative transport. For a detailed explanation of these settings, see the rsync manual page. *** IMPORTANT NOTE ABOUT THE HOST DOCKER DAEMON SETTINGS *** The Docker daemon on the host must be configured to use the http proxy for it to be able to pull the base Ubuntu 14.04 image from the Docker registry before invoking make! In Ubuntu this is done by adding a line like: export http_proxy="http://10.0.0.1:8888/" to /etc/default/docker and restarting the Docker daemon. Change-Id: Ieed2269af295d90a4b33d834f723889bdf9c7dc6 Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com> (cherry picked from commit 0635291a88dd006e15224169524a7fc761ad47ab)
Diffstat (limited to 'fuel/build/docker/Dockerfile')
-rw-r--r--fuel/build/docker/Dockerfile37
1 files changed, 37 insertions, 0 deletions
diff --git a/fuel/build/docker/Dockerfile b/fuel/build/docker/Dockerfile
new file mode 100644
index 000000000..f3d122db9
--- /dev/null
+++ b/fuel/build/docker/Dockerfile
@@ -0,0 +1,37 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# stefan.k.berg@ericsson.com
+# jonas.bjurel@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+FROM ubuntu:14.04
+ENV http_proxy INSERT_HTTP_PROXY
+ENV https_proxy INSERT_HTTPS_PROXY
+ENV no_proxy INSERT_NO_PROXY
+
+RUN apt-get update
+RUN apt-get install -y software-properties-common python-software-properties \
+ make python-setuptools python-all dpkg-dev debhelper \
+ fuseiso git genisoimage bind9-host wget curl lintian tmux lxc iptables \
+ ca-certificates sudo apt-utils lsb-release dosfstools debmirror
+
+RUN echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/open-sudo
+RUN echo "Defaults env_keep += \"ftp_proxy http_proxy https_proxy no_proxy RSYNC_PROXY RSYNC_CONNECT_PROG npm_config_registry\"" > /etc/sudoers.d/keep-proxies
+# Keeping PWD is needed to build as root
+RUN echo "Defaults env_keep += \"PWD\"" > /etc/sudoers.d/keep-pwd
+RUN chmod 0440 /etc/sudoers.d/open-sudo
+RUN chmod 0440 /etc/sudoers.d/keep-proxies
+RUN chmod 0440 /etc/sudoers.d/keep-pwd
+RUN chmod 4755 /bin/fusermount
+
+ADD ./setcontext /root/setcontext
+RUN chmod +x /root/setcontext
+ADD ./enable_dockerx2 /root/enable_dockerx2
+RUN chmod +x /root/enable_dockerx2
+
+VOLUME /var/lib/docker