<p>I am super new to kubernetes and would like your help regarding following matter. </p>

<p>I have used <strong>docker pull php</strong> to pull httpd on my local. </p>

<p>How do I modify this image on my local?</p>

<p>Ok, I will start with the basics: as stated in the previous comments and answers, you cannot modify this image that is coming from <a href="https://hub.docker.com/_/php/" rel="noreferrer">the official PHP image on Docker Hub.</a></p>

<p>However, you have a couple of options when it comes to creating your own image:</p>

<ol>
<li>start from the PHH base image you just pulled and create your own image with a Dockerfile (where the <code>app</code> folder contains your application)</li>
</ol>

<p><code>FROM php:7.1.9-apache
COPY app /var/www/html
EXPOSE 80</code></p>

<p>Then, you just <code>docker build -t my-php-app .</code> and in order to run it locally you <code>docker run -p &lt;some-port&gt;:80 my-php-app</code>.</p>

<p>This is the easiest way to create your new image and <a href="https://docs.docker.com/get-started/part2/" rel="noreferrer">here you can find some good documentation.</a></p>

<ol start="2">
<li>you can run the container, make some changes (add your files, edit configuration and other stuff) and then commit those changes into a new image. You can <a href="https://docs.docker.com/engine/reference/commandline/commit/" rel="noreferrer">find some examples on <code>docker commit</code> here.</a></li>
</ol>

<blockquote>
  <p>However, this second approach doesn't allow you to source control your image creation process (the way you do with a Dockerfile).</p>
</blockquote>

<p>After you create your image, in order to deploy it on another node (other than the one you used to create it), you need to push the image to an image repository (Docker Hub, or some other private image registry - AWS, GCP and Azure all have private image registries).
The default one using the Docker CLI is Docker Hub. <a href="https://docs.docker.com/docker-hub/repos/" rel="noreferrer">Here you can find a tutorial on tagging and pushing your image to Docker Hub</a></p>

<p>Now that you have your image on Docker Hub (or another private image registry), you are ready to deploy it on your Kubernetes cluster.</p>

<p>You can <a href="https://kubernetes.io/docs/user-guide/docker-cli-to-kubectl/" rel="noreferrer">run it in a very similar manner to the one you ran it using Docker</a>:</p>

<p><code>kubectl run --image=&lt;docker-hub-username&gt;/&lt;your-image&gt; your-app-name --port=&lt;port inside container&gt;</code></p>

<p>Then, in order to access it from outside the cluster you need to <a href="https://kubernetes-v1-4.github.io/docs/user-guide/kubectl/kubectl_expose/" rel="noreferrer">expose the deployment</a> which will create a service (and now depending on where your cluster is - cloud/on-prem you can get a public IP from the cloud provider or use the node port):</p>

<p><code>kubectl expose deployment your-app-name --port=80 --name=your-app-service</code></p>

<p>The next step would be to <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment" rel="noreferrer">create YAML files for your deployments</a> and services.</p>

<p>Hope this helps!</p>
