使用Docker文件来构建WordPress图像 [英] Working on a Dockerfile in order to build a WordPress image

查看:132
本文介绍了使用Docker文件来构建WordPress图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个使用Docker的新手,我不明白什么。如果我正在使用官方的Dockerfile来构建官方的WordPress图像,那么我们从...开始:

  FROM php:5.6-apache 

然后,要安装我们必须使用的扩展和模型:

 运行apt-get [安装或更新] 



我的问题是:为什么我们使用 apt-get 如果我们没有在 FROM 中指定我们的图像是一个基于Debian的发行版?我可以使用yum吗?

解决方案

WordPress图像Dockerfile FROM php:5.6-apache 开头



php:5.6-apache image Dockerfile FROM debian:jessie 开头。

因此



每个图像都基于另一个基本图像构建。




I'm a newbie using Docker, and I don't understand something. If I'm using the official Dockerfile used to build the official Wordpress image, we start with:

FROM php:5.6-apache  

Then, to install extensions and models we have to use:

RUN apt-get [install or Update]  

My question is: Why we are using apt-get if we are not specifying in FROM that our image is a Debian based distro? Could I use yum?

解决方案

The WordPress image Dockerfile does begin with FROM php:5.6-apache.

But the php:5.6-apache image Dockerfile starts with FROM debian:jessie.
Hence the apt-get.

Each image builds up based on another base image.

这篇关于使用Docker文件来构建WordPress图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆