FROMus-docker.pkg.dev/migrate-modernize-public/modernize-plugins-prod/service-manager-runtime:1.0.3asservice-manager-runtimeFROMscratch# Tar containing data captured from the source VMADDvmFiles.tar.gz/
COPY--from=service-manager-runtime//
ADDblocklist.yaml/.m4a/blocklist.yaml
ADDlogs.yaml/code/config/logs/logsArtifact.yaml
ADDservices-config.yaml/.m4a/
ADDtempfiles.yaml/.m4a/
# If you want to update parts of the image, add your commands here.# For example:# RUN apt-get update# RUN apt-get install -y \# package1=version \# package2=version \# package3=version# RUN yum update# RUN wget http://github.comENTRYPOINT["/ko-app/service-manager-runtime","start","-c","/.m4a/"]
在以下範例中,我們使用 Cloud Build 和 gcloud CLI 更新從 SUSE Enterprise Linux (SLES) VM 遷移的容器映像檔。以下範例會更新 SLES 發布版本 openssh 套件。
更新後的 Dockerfile:
FROMus-docker.pkg.dev/migrate-modernize-public/modernize-plugins-prod/service-manager-runtime:1.0.3asservice-manager-runtimeFROMscratch# Tar containing data captured from the source VMADDvmFiles.tar.gz/
COPY--from=service-manager-runtime//
ADDblocklist.yaml/.m4a/blocklist.yaml
ADDlogs.yaml/code/config/logs/logsArtifact.yaml
ADDservices-config.yaml/.m4a/
ADDtempfiles.yaml/.m4a/
# If you want to update parts of the image, add your commands here.# For example:# RUN apt-get update# RUN apt-get install -y \# package1=version \# package2=version \# package3=version# RUN yum update# RUN wget http://github.comRUNzypperref-s && zypper-ninopensshENTRYPOINT["/ko-app/service-manager-runtime","start","-c","/.m4a/"]
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Post-migration image updates\n============================\n\nThis page describes how to perform maintenance operations for your\nmigrated workloads.\n\nThe container artifacts that you generate\naren't meant only for deployment of the migrated workload in the target\ncluster.\nYou also need them for *Day 2* maintenance operations, including applying\napplication and user-mode OS software updates, security patches, editing embedded\nconfigurations, adding or replacing files, and for updating the\nMigrate to Containers runtime software.\n\nReview the generated image Dockerfile\n-------------------------------------\n\nMaintenance operations use the generated Dockerfile and the captured\nsystem image layer. When combined with the Migrate to Containers runtime layer,\nthese files can be built into an executable container image.\n\nThe generated container artifacts are created with CI/CD pipeline build\nphase integration in mind, as described in the following diagram:\n\nThe Dockerfile is structured as a\n[multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/),\nfor easier maintenance and manipulation, while keeping the image from inflating.\n\nHere's a sample of a generated Dockerfile: \n\n FROM us-docker.pkg.dev/migrate-modernize-public/modernize-plugins-prod/service-manager-runtime:1.0.3 as service-manager-runtime\n\n FROM scratch\n\n # Tar containing data captured from the source VM\n ADD vmFiles.tar.gz /\n\n COPY --from=service-manager-runtime / /\n\n ADD blocklist.yaml /.m4a/blocklist.yaml\n\n ADD logs.yaml /code/config/logs/logsArtifact.yaml\n\n ADD services-config.yaml /.m4a/\n\n ADD tempfiles.yaml /.m4a/\n\n # If you want to update parts of the image, add your commands here.\n # For example:\n # RUN apt-get update\n # RUN apt-get install -y \\\n # package1=version \\\n # package2=version \\\n # package3=version\n # RUN yum update\n # RUN wget http://github.com\n\n ENTRYPOINT [\"/ko-app/service-manager-runtime\", \"start\", \"-c\", \"/.m4a/\"]\n\nFor more information on building container images with Cloud Build,\nsee [Building container images](/build/docs/building/build-containers).\n\nUpdate the migrated workload components layer\n---------------------------------------------\n\nFor any updates or modifications you want to apply to the migrated workload\nimage layer, you should apply them before the `ENTRYPOINT` directive.\n\nIn the following example, we update a container image migrated from a SUSE\nEnterprise Linux (SLES) VM as source, using Cloud Build and the\ngcloud CLI. The following example updates the SLES distro `openssh`\npackage.\n\nUpdated Dockerfile: \n\n FROM us-docker.pkg.dev/migrate-modernize-public/modernize-plugins-prod/service-manager-runtime:1.0.3 as service-manager-runtime\n\n FROM scratch\n\n # Tar containing data captured from the source VM\n ADD vmFiles.tar.gz /\n\n COPY --from=service-manager-runtime / /\n\n ADD blocklist.yaml /.m4a/blocklist.yaml\n\n ADD logs.yaml /code/config/logs/logsArtifact.yaml\n\n ADD services-config.yaml /.m4a/\n\n ADD tempfiles.yaml /.m4a/\n\n # If you want to update parts of the image, add your commands here.\n # For example:\n # RUN apt-get update\n # RUN apt-get install -y \\\n # package1=version \\\n # package2=version \\\n # package3=version\n # RUN yum update\n # RUN wget http://github.com\n\n RUN zypper ref -s \\&\\& zypper -n in openssh\n\n ENTRYPOINT [\"/ko-app/service-manager-runtime\", \"start\", \"-c\", \"/.m4a/\"]\n\nThen, [deploy the updated image to the cluster](/migrate/containers/docs/deploying-to-target-cluster).\n\nUpdate the Migrate to Containers layer version\n----------------------------------------------\n\nWhen new versions of Migrate to Containers software are released, you can\nupdate that software version in deployed workload images. Such updates may\ninclude new features, enhancements or bug fixes.\n\nTo update the Migrate to Containers software layer, edit the\nDockerfile and change the version tag to the updated version you want to apply.\n\nUsing the previous example, you can update the version from 1.0.3 to the\nhypothetical version 1.0.4 by editing the\n`FROM` directive to the following: \n\n FROM us-docker.pkg.dev/migrate-modernize-public/modernize-plugins-prod/service-manager-runtime:1.0.4 as service-manager-runtime\n\nAfter updating the Dockerfile, you will need to build a new workload container\nimage version and apply it to existing deployments to get it updated.\n\nWhat's next\n-----------\n\n- Learn how to [monitor migrated workloads](/migrate/containers/docs/monitoring-migrated-workloads)."]]