Docker Community Forums

Share and learn in the Docker community.

LAMP Configuration Quality in Popular Dockerfiles?

Before Docker became popular, there was a fairly obvious and wide range of configuration quality for each service out there (i.e. the LAMP stack). We would share config options & various hacks that improved performance, security, flexibility, etc - and I think they were fairly transparent.

Now with Docker, I wonder how much of that has been lost vs migrated into the most popular re-used Dockerfiles (and docker-compose YMLs).

This is clearly a general discussion - and I can only really think of two outcomes:

  1. No; you don’t need that anymore, docker is a layer that prevents expert configs; everything you need is in the docker documentation.
  2. Yes; here are my favorite docker-compose.yml & Dockerfiles for the services I use.

Thanks :slight_smile:

Adding to the discussion:


FROM Command
The FROM command tells the docker file, which images to use as it’s base image. You don’t usually start from complete scratch. I’m sure there are times you can, but they are probably pretty rare circumstances.
In file above, you start with a base image to work from. In this case, we are building off of the latest version of ubuntu.
The syntax for images in docker
In this example its ubuntu:latest. The latest tag is used in most images to grab the most recent version of the image.
ENV Command
ENV DEBIAN_FRONTEND=noninteractive
The line above is allowing you to set an environment variable within your new images. This would be the same as setting an environment variable while SSH’ed into a server. In this case, this makes it so that when we are installing other software and there is a prompt that requires user input, that it will be bypassed and not impeded the software’s installation. I was having my image build fail on a php extension that needed some input. This allowed me to bypass that.
RUN Command
The RUN commands are as if you are typing in a command in your terminal window. In this file, I was installing the php core and it’s corresponding extensions.
COPY Command
The COPY command copies a file from a local directory on your computer to the container’s file system. Think of it like a scp command on a normal server.