1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

KubernetesでデプロイしているPodをImage化する方法

Last updated at Posted at 2020-11-20

kubectl get pod でPod名を確認します。

$ kubectl get pod
NAME                                         READY   STATUS    RESTARTS   AGE
oai                                         1/1     Running   0          28d

docker ps でNameからk8s_Pod名 というものを探し出し、それのコンテナのIDを確認します。

$ docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS               NAMES
6753a38ecfc9        791c227dd604                          "sleep infinity"         4 weeks ago         Up 4 weeks                              k8s_oai

commitをして、イメージ化します。

$ docker commit 6753a38ecfc9 output_name

docker images でイメージ化されたimageを確認します。

$ docker image
REPOSITORY   TAG   IMAGE ID  CREATED  SIZE
output_name  ***   ***       ***      ***
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?