Skip to content
Snippets Groups Projects
Commit 7bc3cd18 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #2215 from metabase/mh-dockerfile-alpine

use alpine as base image and subsequently fix npm build failures
parents 8412e6a3 21e1a208
Branches
Tags
No related merge requests found
.babel_cache/*
docs/*
OSX/*
target/*
**metabase.jar
FROM ubuntu:trusty
FROM java:openjdk-7-jre-alpine
# Make sure we are using UTF-8
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
ENV JAVA_HOME=/usr/lib/jvm/default-jvm
ENV PATH /usr/local/bin:$PATH
ENV LEIN_ROOT 1
# install core build tools
RUN apt-get update && \
apt-get install -y openjdk-7-jdk && \
apt-get install -y nodejs && \
apt-get install -y npm && \
apt-get install -y git && \
apt-get install -y wget
RUN apk add --update nodejs git wget bash python make g++ java-cacerts && \
ln -sf "${JAVA_HOME}/bin/"* "/usr/bin/"
# fix broken cacerts
RUN rm -f /usr/lib/jvm/default-jvm/jre/lib/security/cacerts && \
ln -s /etc/ssl/certs/java/cacerts /usr/lib/jvm/default-jvm/jre/lib/security/cacerts
# install lein
ADD https://raw.github.com/technomancy/leiningen/stable/bin/lein /usr/local/bin/lein
RUN chmod 744 /usr/local/bin/lein
# little bit of cleanup so that our build process will work
ENV PATH /usr/local/bin:$PATH
ENV LEIN_ROOT 1
RUN ln -s /usr/bin/nodejs /usr/bin/node
# add the application source to the image
ADD . /app/source
......@@ -31,6 +23,10 @@ ADD . /app/source
WORKDIR /app/source
RUN bin/build
# remove unnecessary packages & tidy up
RUN apk del nodejs git wget python make g++
RUN rm -rf /root/.lein /root/.m2 /root/.node-gyp /root/.npm /tmp/* /var/cache/apk/* /app/source/node_modules
# expose our default runtime port
EXPOSE 3000
......
FROM java:openjdk-7-jre
FROM java:openjdk-7-jre-alpine
ENV LC_ALL C
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
# need bash
RUN apk add --update bash
# fix broken cacerts
RUN apk add --update java-cacerts && \
rm -f /usr/lib/jvm/default-jvm/jre/lib/security/cacerts && \
ln -s /etc/ssl/certs/java/cacerts /usr/lib/jvm/default-jvm/jre/lib/security/cacerts
# add Metabase jar
COPY ./metabase.jar /app/
......@@ -12,6 +15,9 @@ COPY ./metabase.jar /app/
COPY ./run_metabase.sh /app/
RUN chmod 755 /app/run_metabase.sh
# tidy up
RUN rm -rf /tmp/* /var/cache/apk/*
# expose our default runtime port
EXPOSE 3000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment