use node base image and improve build time/space

- Use node base image, this simplify the Dockerfile, ease the update for
  node stuff.
- Flatten images to decrease layers' size
- Do a shallow clone to speedup build time
This commit is contained in:
Ivan Alejandro 2015-06-13 22:53:22 -03:00
parent d43de2a7e8
commit c5873310c6

View File

@ -20,32 +20,26 @@
# #
# Base docker image # Base docker image
FROM debian:jessie FROM node
MAINTAINER Jessica Frazelle <jess@docker.com> MAINTAINER Jessica Frazelle <jess@docker.com>
# Install dependencies # Install dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \ libasound2 \
ca-certificates \ libgconf-2-4 \
curl \ libgnome-keyring-dev \
git \ libgnome-keyring-dev \
libasound2 \ libgtk2.0-0 \
libgconf-2-4 \ libnss3 \
libgnome-keyring-dev \ libxtst6 && \
libgtk2.0-0 \ apt-get clean && rm -rf /var/lib/apt/lists/*
libnss3 \
libxtst6 \
--no-install-recommends
# install node
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs
# clone atom
RUN git clone https://github.com/atom/atom /src
WORKDIR /src WORKDIR /src
RUN git fetch && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
RUN script/build && script/grunt install RUN LATEST_TAG=`git ls-remote --tags https://github.com/atom/atom | sort -t '/' -k3 --version-sort | tail -n1 | cut -d'/' -f3` && \
git clone -b $LATEST_TAG https://github.com/atom/atom --depth 1 /src && \
script/build && script/grunt install && \
rm -fr /src
# Autorun atom # Autorun atom
CMD /usr/local/bin/atom --foreground --log-file /var/log/atom.log && tail -f /var/log/atom.log CMD /usr/local/bin/atom --foreground --log-file /var/log/atom.log && tail -f /var/log/atom.log