我有Dockerfile
一些命令:
FROM ubuntu
RUN apt-get install -y nginx php5 php5-fpm
ADD . /code
当我运行docker build .
命令时,我得到下一个错误:
E: Package 'php5-fpm' has no installation candidate
INFO[0006] The command [/bin/sh -c apt-get install nginx php5 php5-fpm] returned a non-zero code: 100
如何根据Nginx
图片php-fpm
启动Ubuntu
?
答案 0 :(得分:1)
NGiNX
可以看到更多complete example here:
# Install Nginx.
RUN \
add-apt-repository -y ppa:nginx/stable && \
apt-get update && \
apt-get install -y nginx && \
rm -rf /var/lib/apt/lists/* && \
echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
chown -R www-data:www-data /var/lib/nginx
对于php-fpm
,您有this example:
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys E5267A6C; \
echo 'deb http://ppa.launchpad.net/ondrej/php5/ubuntu trusty main' > /etc/apt/sources.list.d/ondrej-php5-trusty.list; \
apt-get update ; \
apt-get -y install php5-fpm php5-mysql php-apc php5-imagick php5-imap php5-mcrypt php5-curl php5-cli php5-gd php5-pgsql php5-sqlite php5-common php-pear curl php5-json php5-redis redis-server memcached php5-memcache ; \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
在这两种情况下,请注意使用:
add-apt-repository
以便为要安装的软件包添加相关的存储库apt-get update
,以downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies。