A LAMP docker container on ubuntu 16.04
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
Theodotos Andreou 7f5b6458b9 Added LICENSE 5 年前
Dockerfile Added destination in the ADD command 7 年前
LICENSE Added LICENSE 5 年前
README.md Migrated from Github 5 年前
entrypoint.sh Revert previous changes 7 年前

README.md

Ubuntu 16.04 (aka xenial) LAMP Docker container

This project bulds a simple Ubuntu 16.04 LAMP docker container. It is based on the official Ubuntu 16.04 (xenial) Docker image.

What's included:

  • Ubuntu 16.04.1 LTS
  • Apache 2.4.18
  • MariaDB Server 10.0.27
  • PHP 7.0.8

Build instructions

  • Download the ubuntu-lamp-docker repository:
git clone https://git.theo-andreou.org/Personal/ubuntu-lamp-docker.git
  • Build the image:
cd ubuntu-lamp-docker
docker build -t "username/ubuntu-lamp" .
Verify that the image has been created in the local image store:
docker images  | grep ubuntu-lamp
theodotos/ubuntu-lamp        latest              f54ab36adc4f        About a minute ago   508.8 M

Use it directly from Docker Hub

If you do not want to build it yourself you can pull it from https://hub.docker.com:

docker pull theodotos/ubuntu-lamp

Run the container

  • Prepare the necessary volumes for persistency:
docker volume create --name lamp-mariadb
docker volume create --name lamp-docroot
docker volume create --name lamp-apache-conf
docker volume create --name lamp-mariadb-conf
  • Run the container:
docker run -d -p 2080:80 -p 2443:443 --name lamp -v lamp-mariadb:/var/lib/mysql -v lamp-docroot:/var/www/html -v lamp-apache-conf:/etc/apache2 -v lamp-mariadb-conf:/etc/mysql theodotos/ubuntu-lamp
  • Verify that its up and running:
docker ps | grep lamp
c5b0f3d48307        theodotos/ubuntu-lamp   "/bin/sh -c /entrypoi"   About a minute ago   Up About a minute   3306/tcp, 0.0.0.0:2080->80/tcp, 0.0.0.0:2443->443/tcp   lamp
  • Check the logs:
docker logs lamp
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
160923 04:35:57 mysqld_safe Logging to syslog.
160923 04:35:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql