I am seeing a very weird behaviour with building /updating wordpress docker image from source (either locally on my laptop or via Cloud Build) and pushing to AR or even GCR. The images after pushing to AR and GCR do not have my updates or even missing files in cases where I am adding new files. Any other codebase Go, Node works fine, issue is see only with WP builds.
FYI I compared layers and Digest on both local and remote image and they look fine.
Can you share your Dockerfile and your build commands and/or Cloud Build yaml?
Hey Gary,
First of all thank you so much for your reply. I now realize that this is not WP related or any other programming language it is just files updated that are modified / added and not reflecting in the container image so runtime does not matter i feel . I am pasting the Dockerfile and also the CloudBuild file.
Cloudbuild.yaml
args: ['build', '.', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/xxxxxx/xxxxx:${BRANCH_NAME}-${SHORT_SHA}','--no-cache']
Dockerfile
FROM wordpress:6.3.1-apache
WORKDIR /var/www/html
COPY . /var/www/html
RUN rm -fr /usr/src/wordpress/wp-content
COPY wp-content/ /usr/src/wordpress/wp-content/
RUN chown -R www-data:www-data /usr/src/wordpress/wp-content
EXPOSE 80
Hi @dheerajpanyam,
Welcome to Google Cloud Community!
Based on your cloud build file, you might be missing images build, please see below sample file content that might be helpful to you:
Cloudbuild.yaml
args: ['build', '.', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/xxxxxx/xxxxx:${BRANCH_NAME}-${SHORT_SHA}','--no-cache']
images:
- 'us-central1-docker.pkg.dev/$PROJECT_ID/xxxxxx/xxxxx:${BRANCH_NAME}-${SHORT_SHA}:tag1'
You can use the following links as reference for additional information:
1. https://cloud.google.com/build/docs/cloud-builders#supported_builder_images_provided_by
2. https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/gcloud/cloudbuild.yaml
I hope this information is helpful. Please let me know if you have any other questions.
Thanks @RonEtch let me give it a try. I will get back to you.
@RonEtch I added images attribute but i still don't see my code changes in the docker image built by GCB.
Hi @RonEtch , the issue we are facing here is whenever we have new changes to the Wordpress files through CI (cloudbuild file) it will build the new image and deploy the new image to GKE but when we exec into POD we can't see the new changes in the Wordpress files changes.
Hi @Ch_Varun
Welcome to Google Cloud Community!
You can isolate the troubleshooting by creating identifiable new image name with tags while using the Ci (cloudbuild file), and verify that the exact image is being used when deployed in the GKE cluster.
If you are using Google CD (cloud deploy) you can create an isolated pipeline by following this documentation and run the release to an isolated GKE by following this documentation.
If you need further assistance, you can always file a ticket on our support team.
I hope this information is helpful.
@RonEtch We are building the new image and tagging with GH commit id (whenever new changes to the wordpress files has been commited to GH it builds new image with the commit id tags using cloudbuild).
The new image commit id tag which has the latest changes has been deployed to the GKE(using cloudbuild) but when we exec into the POD we dont see the latest changes.