gpt4 book ai didi

docker - 在Google Cloud Platform中更新Docker镜像

转载 作者:行者123 更新时间:2023-12-02 20:51:39 25 4
gpt4 key购买 nike

我以为我已经找到了如何在Google Container Engine中更新Docker镜像的方法,但是现在它只是恢复为该镜像的原始版本。这是我所做的:

原始图片

docker build -t gcr.io/jupiter-1068/jupiter .
gcloud docker push gcr.io/jupiter-1068/jupiter
kubectl create -f rc.yaml

v2
docker build -t gcr.io/jupiter-1068/jupiter:2 .
gcloud docker push gcr.io/jupiter-1068/jupiter:2
kubectl rolling-update staging --image=gcr.io/jupiter-1068/jupiter:2

这工作了。 但后来我尝试以与v2相同的方式更新到v3,它似乎正在运行原始图像代码。 这是怎么回事?

更新

再次尝试使用 :latestkubectl describe rc staging的输出:
Name:       staging
Namespace: default
Image(s): gcr.io/jupiter-1068/jupiter:latest
Selector: app=jupiter,deployment=f400f87308696febbe567614f3cc3428,version=1
Labels: run=staging
Replicas: 1 current / 1 desired
Pods Status: 1 Running / 0 Waiting / 0 Succeeded / 0 Failed
No events.
kubectl describe pod <podname>的输出:
Name:               staging-b4c7103521d97ef91f482db729da9584-0va8i
Namespace: default
Image(s): gcr.io/jupiter-1068/jupiter:latest
Node: gke-staging-4adcf7c5-node-ygf7/10.240.251.174
Labels: app=jupiter,deployment=f400f87308696febbe567614f3cc3428,version=1
Status: Running
Reason:
Message:
IP: 10.8.0.24
Replication Controllers: staging (1/1 replicas created)
Containers:
jupiter:
Image: gcr.io/jupiter-1068/jupiter:latest
Limits:
cpu: 100m
State: Running
Started: Tue, 15 Sep 2015 21:08:32 -0500
Ready: True
Restart Count: 1
Conditions:
Type Status
Ready True
Events:
FirstSeen LastSeen Count From SubobjectPath Reason Message
Tue, 15 Sep 2015 21:07:05 -0500 Tue, 15 Sep 2015 21:07:05 -0500 1 {scheduler } scheduled Successfully assigned staging-b4c7103521d97ef91f482db729da9584-0va8i to gke-staging-4adcf7c5-node-ygf7
Tue, 15 Sep 2015 21:07:05 -0500 Tue, 15 Sep 2015 21:07:05 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} implicitly required container POD pulled Pod container image "gcr.io/google_containers/pause:0.8.0" already present on machine
Tue, 15 Sep 2015 21:07:05 -0500 Tue, 15 Sep 2015 21:07:05 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} implicitly required container POD created Created with docker id 13cd80e199a4
Tue, 15 Sep 2015 21:07:05 -0500 Tue, 15 Sep 2015 21:07:05 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} implicitly required container POD started Started with docker id 13cd80e199a4
Tue, 15 Sep 2015 21:07:05 -0500 Tue, 15 Sep 2015 21:07:05 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} spec.containers{jupiter} created Created with docker id 724fdedd11be
Tue, 15 Sep 2015 21:07:05 -0500 Tue, 15 Sep 2015 21:07:05 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} spec.containers{jupiter} started Started with docker id 724fdedd11be
Tue, 15 Sep 2015 21:08:32 -0500 Tue, 15 Sep 2015 21:08:32 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} spec.containers{jupiter} created Created with docker id 2022b9f5f054
Tue, 15 Sep 2015 21:08:32 -0500 Tue, 15 Sep 2015 21:08:32 -0500 1 {kubelet gke-staging-4adcf7c5-node-ygf7} spec.containers{jupiter} started Started with docker id 2022b9f5f054

最佳答案

docker中的:latest标签有点令人困惑。这并不意味着最新上传,它是您未指定标签时设置的默认名称。

在您的方案中,:latest指向您的原始图像,因为这是您未指定标签的唯一上载。

关于docker - 在Google Cloud Platform中更新Docker镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32598423/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com