sudo mkdir -p /media/web
sudo chown -R pi:root /media/web
ALLIP=`sudo hostname -I`
IP=`echo $ALLIP|cut -d' ' -f1`
docker run -it -d -\
p $IP:80:80 \
--restart unless-stopped \
-v /media/web:/var/www/html/ \
--name apache-php oz8et/apache-php
mkdir ~/apache_php
cd ~/apache_php
nano Dockerfile
Insert the following content:
FROM debian
RUN apt-get update -y
RUN apt-get install apache2 php php-mysql -y
ENV directoriohtml /var/www/html/
RUN echo "<?php phpinfo(); ?>" > "$directoriohtml"info.php
VOLUME MiVolumen
EXPOSE 80
CMD apachectl -DFOREGROUND
save and exit.
docker build -t oz8et/apache-php .
create and run container as above.
Content type
Image
Digest
Size
94.8 MB
Last updated
over 5 years ago
docker pull oz8et/apache-php