Create image Problem. Please Help Me!


My name is Anıl Eyyüp Yılmaz. I am studying at İstanbul Kültür Universty I choose graduation project topic from docker container. I have big problem. Can you help me ?

I have a website which is written in php. I have a folder of website, ı should convert to the image. How can i convert? Thank you.

I tried many times but i failed. First i created dockerfile but i couldn’t deside what ı should write inside of the dockerfile. Please help me ?

my e-mail address is anileyyupyilmaz@gmail.com

Hi Anil,

First you have to decide the Docker base image. There are several PHP Dockerfile that you can use for your base image. If you want an image where your Apache service is installed already for your PHP app, use php:7.0-apache image, then copy your existing file contents to /usr/src/myapp in the container, set the working directory this directory, expose a port and run your file as: CMD [ “php”, “./your-script.php” ].

Here you can find more information.

Firstly thank you for your interest,

i did and i pulled this one and i read all of them, but i didnt understand what should i write inside of Dockerfille.

FROM php:7.0-apache
…(ı dont know rest of this one)

and than ı dont know what should write.
What is the meaning of “./your-script.php” ? I have lots of file as you can see the picture. And also there are many files in others files.

Thank you,