码迷,mamicode.com
首页 > 其他好文 > 详细

Hadoop的Docker镜像构建

时间:2016-12-08 18:30:57      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:lib   mave   iat   installer   port   conf   cti   XML   wget   

1、Dockerfile

###Dockerfile   -- beagin
FROM ubuntu:trusty
#MAINTAINER The Hue Team "https://github.com/cloudera/hue"

RUN apt-get update -y

RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get update -y

RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
RUN apt-get install -y oracle-java8-installer

RUN apt-get update -y
RUN apt-get install --fix-missing -q -y   git   ant   gcc   g++   libkrb5-dev   libmysqlclient-dev   libssl-dev   libsasl2-dev   libsasl2-modules-gssapi-mit   libsqlite3-dev   libtidy-0.99-0   libxml2-dev   libxslt-dev   libffi-dev   make   maven   libldap2-dev   python-dev   python-setuptools   libgmp3-dev   libz-dev
#Download Hadoop from one of these mirrors. Change the version number appropriately:
RUN wget http://apache.mirrors.tds.net/hadoop/common/hadoop-2.7.2/hadoop-2.7.2.tar.gz -P ~/Downloads
#Extract it to /usr/local:
RUN tar zxvf ~/Downloads/hadoop-* -C /usr/local
#Rename the directory to just hadoop:
RUN mv /usr/local/hadoop-* /usr/local/hadoop
###Dockerfile   -- end

2、修改配置

#Set Environment Variables
#Find Java with:
#readlink -f $(which java)
#Environment variables:
$ echo "export JAVA_HOME=/usr/lib/jvm/java-8-oracle" >> ~/.bashrc
#$ source ~/.bashrc

$ echo "export PATH=$PATH:$JAVA_HOME/bin" >> ~/.bashrc
#$ source ~/.bashrc

$ echo "export HADOOP_HOME=/usr/local/hadoop" >> ~/.bashrc
#$ source ~/.bashrc

$ echo "export PATH=$PATH:$HADOOP_HOME/bin" >> ~/.bashrc
#$ source ~/.bashrc

$ echo "export HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop" >> ~/.bashrc
$ source ~/.bashrc

3、构建镜像

docker build -t hadoop .

 

Hadoop的Docker镜像构建

标签:lib   mave   iat   installer   port   conf   cti   XML   wget   

原文地址:http://www.cnblogs.com/HendSame-JMZ/p/6145506.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!