diff --git a/Dockerfile b/Dockerfile index 75327f7..4265913 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ FROM maven:3.5.4-jdk-8 AS stage-atlas -ENV ATLAS_REPO https://www-eu.apache.org/dist/atlas/1.1.0/apache-atlas-1.1.0-sources.tar.gz +ENV ATLAS_VERSION 2.0.0 +ENV TARBALL apache-atlas-${ATLAS_VERSION}-sources.tar.gz +ENV ATLAS_REPO https://dist.apache.org/repos/dist/dev/atlas/${ATLAS_VERSION}-rc0/${TARBALL} ENV MAVEN_OPTS "-Xms2g -Xmx2g" -RUN curl ${ATLAS_REPO} -o apache-atlas-1.1.0-sources.tar.gz \ - && tar xzf apache-atlas-1.1.0-sources.tar.gz \ - && cd apache-atlas-sources-1.1.0 \ +RUN curl ${ATLAS_REPO} -o ${TARBALL} \ + && tar xzf ${TARBALL} \ + && cd apache-atlas-sources-${ATLAS_VERSION} \ && mvn clean -DskipTests package -Pdist,embedded-hbase-solr \ && mv distro/target/apache-atlas-*-bin.tar.gz /apache-atlas.tar.gz @@ -13,20 +15,28 @@ FROM centos:7 COPY --from=stage-atlas /apache-atlas.tar.gz /apache-atlas.tar.gz -ADD resources/entrypoint.sh /entrypoint.sh - RUN yum update -y \ && yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel python net-tools -y \ && yum clean all +RUN groupadd hadoop && \ + useradd -m -d /opt/atlas -g hadoop atlas + +USER atlas + RUN cd /opt \ - && tar xzf /apache-atlas.tar.gz \ - && rm -rf /apache-atlas.tar.gz + && tar xzf /apache-atlas.tar.gz -C /opt/atlas --strip-components=1 COPY model /tmp/model COPY resources/atlas-setup.sh /tmp COPY resources/credentials /tmp -COPY resources/atlas-application.properties /opt/apache-atlas-1.1.0/conf/ +COPY resources/atlas-application.properties /opt/atlas/conf/ + +USER root +ADD resources/entrypoint.sh /entrypoint.sh +RUN rm -rf /apache-atlas.tar.gz + +USER atlas ENTRYPOINT ["sh", "-c", "/entrypoint.sh"] diff --git a/resources/atlas-setup.sh b/resources/atlas-setup.sh index 0e3ede9..b011d3e 100755 --- a/resources/atlas-setup.sh +++ b/resources/atlas-setup.sh @@ -40,7 +40,7 @@ if [ "$start_timeout_exceeded" = "false" ]; then if [ ! -z "${ATLAS_PROVISION_EXAMPLES}" ]; then # Need faketty as otherwise we cannot supply credentials - faketty /opt/apache-atlas-1.1.0/bin/quick_start.py http://localhost:21000 < /tmp/credentials + faketty /opt/atlas/bin/quick_start.py http://localhost:21000 < /tmp/credentials echo "Done provisioning example data" fi else diff --git a/resources/entrypoint.sh b/resources/entrypoint.sh index d3b52d5..221f486 100755 --- a/resources/entrypoint.sh +++ b/resources/entrypoint.sh @@ -4,7 +4,7 @@ export MANAGE_LOCAL_HBASE=true export MANAGE_LOCAL_SOLR=true export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk -opt/apache-atlas-1.1.0/bin/atlas_start.py +/opt/atlas/bin/atlas_start.py sh /tmp/atlas-setup.sh tail -f /dev/null