Working on a Dockerfile in order to build a WordPr

2019-05-18 20:11发布

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?

1条回答
神经病院院长
2楼-- · 2019-05-18 20:35

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.

https://docs.docker.com/terms/images/docker-filesystems-multilayer.png

查看更多
登录 后发表回答