2016-04-04 105 views
1

我是AWS elastic beanstalk的用户,我有一个小问题。我想用更少的+节点构建我的CSS文件。但我不知道如何在使用jenkins构建时在我的dockerfile中安装节点。在Dockerfile中安装节点?

这里是我在码头使用的安装包。我会很乐意提供任何建议。

FROM php:5.6-apache 


# Install PHP5 and modules along with composer binary 
RUN apt-get update 
RUN apt-get -y install \ 
    curl \ 
    default-jdk \ 
    git \ 
    libcurl4-openssl-dev \ 
    libpq-dev \ 
    libmcrypt-dev \ 
    libpq5 \ 
    npm \ 
    node \ 
    zlib1g-dev \ 
    libfreetype6-dev \ 
    libjpeg62-turbo-dev \ 
    libpng12-dev 

RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 

RUN docker-php-ext-install curl json mbstring opcache pdo_mysql zip gd exif sockets mcrypt 

# Install pecl 
RUN pecl install -o -f memcache-beta \ 
    && rm -rf /tmp/pear \ 
    && echo 'extension=memcache.so' > /usr/local/etc/php/conf.d/memcache.ini 

在此之后,我乳宁我entrypoint.sh与代码

#!/usr/bin/env sh 

composer run-script post-install-cmd --no-interaction 

chmod 0777 -R /var/app/app/cache 
chmod 0777 -R /var/app/app/logs 

exec apache2-foreground 

但后来I`ve得到这个错误

Error Output: [2016-04-04 11:23:44] assetic.ERROR: The template ":tmp:module.html.twig" contains an error: A template that extends another one cannot have a body in ":tmp:module.ht 
    ml.twig" at line 7.  

但是,当我安装多克尔容器节点这里面way

apt-get install git-core curl build-essential openssl libssl-dev 
git clone https://github.com/nodejs/node.git 
cd node 
./configure 
make 
sudo make install 
node -v 

I ca ñ建立我的CSS。所以问题是..当我使用Jenkins构建它时,上面的安装如何在我的Dockerfile中进行安装?

回答

0

运行apt-get install node不会安装Node.js,因为这不是您要求的软件包。

如果运行apt-cache info node,你可以看到你安装的是一个“业余分组无线节点程序(过渡包)”

您应该遵循the Node.js install instructions通过包管理器安装。

如果你喜欢从git的建筑,你可以做这里面泊坞窗:

RUN apt-get install git-core curl build-essential openssl libssl-dev \ 
&& git clone https://github.com/nodejs/node.git \ 
&& cd node \ 
&& ./configure \ 
&& make \ 
&& sudo make install 
+0

谢谢。我很愚蠢..没有意识到这一点。工作,非常感谢:) – Delirium