最小docker的图像做一些meteorunit testing

我正在docker容器中进行unit testing(对于我的CI工作stream程)。 因此,我已经用nodeJS(4.x)和meteorJS(1.5)构build了一个基于Ubuntu的映像。 我必须添加一个Ubuntu用户,因为根用户使meteor的一些问题,我必须设置语言环境来解决已知的问题与mongoDB。

在结果图像有2 GB的! 这对我来说是不可思议的。 只是做unit testing太多了。

我也尝试过使用一个阿尔卑斯山版本(node:4.8-alpine),但是由于我没有得到meteor test运行

我的命令来运行CI设置中的unit testing:

 TEST_CLIENT=0 meteor test --once --driver-package dispatch:mocha --allow-superuser 

这是我正在使用的Dockerfile:

 FROM ubuntu:16.04 COPY package.json ./ RUN apt-get update -y && \ apt-get install -yqq \ python \ build-essential \ apt-transport-https \ ca-certificates \ curl \ locales \ nodejs \ npm \ nodejs-legacy \ sudo \ git && \ rm -rf /var/lib/apt/lists/* ## NodeJS and MeteorJS RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - RUN curl https://install.meteor.com/ | sh ## Dependencies RUN npm install -g eslint eslint-plugin-react RUN npm install -g standard RUN npm install ## Locale ENV OS_LOCALE="en_US.UTF-8" RUN locale-gen ${OS_LOCALE} ENV LANG=${OS_LOCALE} LANGUAGE=en_US:en LC_ALL=${OS_LOCALE} ## User RUN useradd ubuntu && \ usermod -aG sudo ubuntu && \ mkdir -p /builds/project/testing/.meteor /home/ubuntu && \ chown -Rh ubuntu:ubuntu /builds/project/testing/.meteor && \ chown -Rh ubuntu:ubuntu /home/ubuntu USER ubuntu ## Initialize meteor RUN cd /builds/project/testing/ && meteor update --release 1.5 

也许有人有一个想法如何优化这个Dockerfile …