I manage the Kubernetes environments at work and am studying Docker in order to provide better help for the developers.
Right now I’m trying to set up a simple static website in a docker container, then save it to a local registry, and finally deploy it to a Kubernetes cluster.
I’m following a tutorial in creating a docker container which is working fine. I’m able to use a docker-compose.yml file and a Dockerfile to pull the php:7-apache image and copy my small website into /var/www/html and docker run it. I get the website on localhost:8080 without a problem so that works fine.
Tagging the container also works fine but docker push to the registry fails to copy the contents of /var/www/html.
It seems like I’m missing a command or process to make the contents ov /var/www/html a part of that final tagged image.
All the tutorials I’ve been following are all assuming I’m working on a stand alone docker server and not pushing a built image with a separate website to an orchestration environment like Kubernetes or Swarm. They are all pushing nginx (for example) and showing the results as, “see, I got the nginx default webpage” which doesn’t help with a personal website.
I did check the docs and see docker commit but it appears to be a quick-and-dirty tool as it says that work should be done in a dockerfile. Checking the reference for dockerfile doesn’t show a command for merging the website into a fresh image.
A pointer to a better developer type tutorial would be great or just confirming that ‘docker commit’ is actually the right command for adding my website to an image.
Thanks in advance.