Merge changes from topic 'multiarch-mirrors'
[fuel.git] / build / docker / Dockerfile
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 FROM ubuntu:14.04
13 ENV http_proxy INSERT_HTTP_PROXY
14 ENV https_proxy INSERT_HTTPS_PROXY
15 ENV no_proxy INSERT_NO_PROXY
16 ENV DEBIAN_FRONTEND noninteractive
17
18 RUN apt-get update
19 RUN apt-get install -y software-properties-common python-software-properties \
20     make python-setuptools python-all dpkg-dev debhelper ruby-json \
21     fuseiso git genisoimage bind9-host wget curl lintian tmux lxc iptables \
22     ca-certificates sudo apt-utils lsb-release dosfstools debmirror p7zip-full \
23     build-essential ruby-dev rubygems-integration python-pip git rpm createrepo dpkg-dev
24
25 RUN gem install fpm
26 RUN pip install fuel-plugin-builder
27
28 RUN echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/open-sudo
29 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
30 # Keeping PWD is needed to build as root
31 RUN echo "Defaults env_keep += \"PWD\"" > /etc/sudoers.d/keep-pwd
32 # Keeping variables for ISO build
33 RUN echo "Defaults env_keep += \"MIRROR_UBUNTU MIRROR_UBUNTU_ROOT MIRROR_MOS_UBUNTU MIRROR_MOS_UBUNTU_ROOT MIRROR_FUEL LATEST_TARGET_UBUNTU UBUNTU_ARCH\"" > /etc/sudoers.d/keep-mos
34 RUN chmod 0440 /etc/sudoers.d/open-sudo
35 RUN chmod 0440 /etc/sudoers.d/keep-proxies
36 RUN chmod 0440 /etc/sudoers.d/keep-pwd
37 RUN chmod 0440 /etc/sudoers.d/keep-mos
38 RUN chmod 4755 /bin/fusermount
39
40 ADD ./setcontext /root/setcontext
41 RUN chmod +x /root/setcontext
42
43 VOLUME /var/lib/docker