0

I want to create an PHP/Apache Docker container as follows:

Dockerfile

FROM ubuntu:latest
FROM php:5.4-apache
RUN a2enmod ssl && a2enmod rewrite
RUN apt-get update && apt-get upgrade -y  --allow-unauthenticated
RUN apt-get install software-properties-common -y --force-yes
RUN apt-get update
RUN apt-get install git libonig-dev libxml2-dev sqlite3 libsqlite3-dev curl libzip-dev libcurl4-openssl-dev zip unzip jq libldap2-dev net-tools libpng-dev -y --force-yes
RUN docker-php-ext-install mysql mysqli gd
RUN apt-get update
EXPOSE 80
EXPOSE 443

docker-compose.yaml:

version: '3.3'
services:
  wawi_web_production:
    container_name: wawi_web_production
    build:
      context: ./apache
      dockerfile: Dockerfile
    volumes:
      - ./app:/var/www/html/
      - ./apache/wawi.conf:/etc/apache2/sites-available/000-default.conf
    ports:
      - '8000:80'
      - '8080:443'

and run docker-compose with:

docker-compose up --build -d --force-recreate

However, checking the OS inside the container, I get the following:

root@containerid:/var/www/html# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.11 (jessie)
Release:        8.11
Codename:       jessie
root@containerid:/var/www/html# 

I want to have an up to date OS, what am I doing wrong?

Doğan Uçar
  • 166
  • 3
  • 15
  • Do you know what the `FROM`directive odes? Do you know what happens when you write multiple of them? – Turing85 Dec 04 '22 at 12:52
  • I'd suggest that if you want to avoid security vulnerabilities, it doesn't really matter what version of Ubuntu you're running if you're using a PHP version which stopped getting security updates seven years ago. – Nick ODell Dec 04 '22 at 13:09

0 Answers0