-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(dev/docker/hive): shrink hive Docker image size by 420MB #3268
Changes from all commits
cb42b79
3c74f90
87230d6
193921d
52b5939
332004c
daad34f
47a4149
4c75621
acf79aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,10 @@ | |
FROM ubuntu:16.04 | ||
LABEL maintainer="support@datastrato.com" | ||
|
||
ARG HADOOP_PACKAGE_NAME | ||
ARG HIVE_PACKAGE_NAME | ||
ARG HADOOP_VERSION | ||
ARG HIVE_VERSION | ||
ARG JDBC_DIVER_PACKAGE_NAME | ||
ARG MYSQL_JDBC_DRIVER_VERSION | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR / | ||
|
@@ -41,12 +42,10 @@ RUN apt-get update && apt-get upgrade -y && apt-get install --fix-missing -yq \ | |
openjdk-8-jdk | ||
|
||
################################################################################# | ||
## setup ssh | ||
# setup ssh | ||
RUN mkdir /root/.ssh | ||
RUN cat /dev/zero | ssh-keygen -q -N "" > /dev/null && cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys | ||
|
||
COPY packages /tmp/packages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can use then, seems we do not need two stage build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for you advise! I used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I'll try the soft-link approach, thanks 😀 |
||
|
||
################################################################################ | ||
# set environment variables | ||
ENV JAVA_HOME=/usr/local/jdk | ||
|
@@ -91,7 +90,8 @@ RUN echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> /etc/environment | |
################################################################################ | ||
# install hadoop | ||
RUN mkdir ${HADOOP_HOME} | ||
RUN tar -xz -C ${HADOOP_HOME} --strip-components 1 -f /tmp/packages/${HADOOP_PACKAGE_NAME} | ||
ADD packages/hadoop-${HADOOP_VERSION}.tar.gz /opt/ | ||
RUN ln -s /opt/hadoop-${HADOOP_VERSION}/* ${HADOOP_HOME} | ||
|
||
# replace configuration templates | ||
RUN rm -f ${HADOOP_CONF_DIR}/core-site.xml | ||
|
@@ -111,7 +111,9 @@ RUN ${HADOOP_HOME}/bin/hdfs namenode -format -nonInteractive | |
################################################################################ | ||
# install hive | ||
RUN mkdir ${HIVE_HOME} | ||
RUN tar -xz -C ${HIVE_HOME} --strip-components 1 -f /tmp/packages/${HIVE_PACKAGE_NAME} | ||
ADD packages/apache-hive-${HIVE_VERSION}-bin.tar.gz /opt/ | ||
RUN ln -s /opt/apache-hive-${HIVE_VERSION}-bin/* ${HIVE_HOME} | ||
|
||
ADD hive-site.xml ${HIVE_HOME}/conf/hive-site.xml | ||
|
||
################################################################################ | ||
|
@@ -127,7 +129,8 @@ RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/ | |
|
||
################################################################################ | ||
# add mysql jdbc driver | ||
RUN tar -xz -C ${HIVE_HOME}/lib --strip-components 1 -f /tmp/packages/${JDBC_DIVER_PACKAGE_NAME} | ||
ADD packages/mysql-connector-java-${MYSQL_JDBC_DRIVER_VERSION}.tar.gz /opt/ | ||
RUN ln -s /opt/mysql-connector-java-${MYSQL_JDBC_DRIVER_VERSION}/* ${HIVE_HOME}/lib | ||
|
||
################################################################################ | ||
# add users and groups | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need kept
LABEL maintainer="support@datastrato.com"
in the here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I don't use 2 stage build right now, this review is outdated.