0
0

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.

Docker チートシート

Last updated at Posted at 2021-08-24

#イメージ一覧表示

$ docker image ls
REPOSITORY            TAG       IMAGE ID       CREATED        SIZE
ubuntu                latest    1318b700e415   4 weeks ago    72.8MB

#イメージ削除

$ docker rmi $imageid -f

#dockerイメージにタグをつけるコマンド

docker tag $元のイメージ名:$タグ名 $ユーザー名/$イメージ名:$タグ名

#イメージからコンテナを作成し実行

$ docker run --name $container_name -it $image_name /bin/bash

#コンテナ確認

$ docker ps

CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

#コンテナ削除

$ docker rm $containerid

-fオプションで強制削除。IDの複数選択も可能。

#コンテナ起動

$ docker start $containername

#コンテナ停止

$ docker stop $containername

#コンテナに入る

$ docker exec -it $containername bash

#DockerコンテナからDockerイメージを更新する

$ docker commmit $containername $imagename:$tagname

#docker hubにログイン

$ docker login

#docker hubに指定したイメージをアップロードするコマンド

$ docker push user/server01:0.1
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?