首页 > 代码库 > Hadoop的Docker镜像构建
Hadoop的Docker镜像构建
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镜像构建
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。