Background:

The K8S environment was used in the project, and every update was packaged as a Docker image and pushed to the Harbor warehouse. Previously, it was a full release, which meant replacing all the files to be updated locally and then re-mirroring the entire package.

Question:

  1. Sometimes a project is not maintained by only one person, and local files may not be the latest, so there is a risk of missing updates.
  2. Repackage the entire project each time, which is slow.

Solution:

  1. Run the docker pull command docker pull 192.168.1.8/patrol-svr/patrol-svr:v1.01 to pull the image of the latest version from the server to the local PC
  2. Update and copy the latest local image.

Dockerfile contains the following contents:

The FROM 192.168.1.8 / patrol - SVR/patrol - SVR: v1.01

COPY module /usr/local/pipenet-docker-patrol/module

Add module1 /usr/local/pipenet-docker-patrol/

Remark:

The COPY command is used to COPY a file or folder to the corresponding path and replace the content of the file. The Add command adds a file or folder to the corresponding path.

Defect:

The contents in the image cannot be deleted. To delete a file in the image, publish the file in full.