forked from big-data-europe/docker-hadoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
21 lines (20 loc) · 1.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DOCKER_NETWORK = hbase
ENV_FILE = hadoop.env
current_branch := $(shell git rev-parse --abbrev-ref HEAD)
base_version := --build-arg HADOOP_BASE_VERSION=$(current_branch)
build:
docker build -t bde2020/hadoop-base:$(current_branch) ./base
docker build -t bde2020/hadoop-namenode:$(current_branch) $(base_version) ./namenode
docker build -t bde2020/hadoop-datanode:$(current_branch) $(base_version) ./datanode
docker build -t bde2020/hadoop-resourcemanager:$(current_branch) $(base_version) ./resourcemanager
docker build -t bde2020/hadoop-nodemanager:$(current_branch) $(base_version) ./nodemanager
docker build -t bde2020/hadoop-historyserver:$(current_branch) $(base_version) ./historyserver
docker build -t bde2020/hadoop-submit:$(current_branch) $(base_version) ./submit
wordcount:
docker build -t hadoop-wordcount ./submit
docker run --network ${DOCKER_NETWORK} --env-file ${ENV_FILE} bde2020/hadoop-base:$(current_branch) hdfs dfs -mkdir -p /input/
docker run --network ${DOCKER_NETWORK} --env-file ${ENV_FILE} bde2020/hadoop-base:$(current_branch) hdfs dfs -copyFromLocal -f /opt/hadoop/README.txt /input/
docker run --network ${DOCKER_NETWORK} --env-file ${ENV_FILE} hadoop-wordcount
docker run --network ${DOCKER_NETWORK} --env-file ${ENV_FILE} bde2020/hadoop-base:$(current_branch) hdfs dfs -cat /output/*
docker run --network ${DOCKER_NETWORK} --env-file ${ENV_FILE} bde2020/hadoop-base:$(current_branch) hdfs dfs -rm -r /output
docker run --network ${DOCKER_NETWORK} --env-file ${ENV_FILE} bde2020/hadoop-base:$(current_branch) hdfs dfs -rm -r /input