Docker2021

2021/06/29

参考資料

Centos8初期設定

Docker

  • コンテナ を作成・起動する
    docker run -it --name="centos8f" centos:centos8 /bin/bash
    
  • 停止中のコンテナを再開する
    docker start centos8f
    
  • 起動中のコンテナへ接続する
    docker attach centos8f
    
  • docker rmi コマンドを用いて、取得したDockerイメージを削除 ~~~ docker images

docker ps -a

docker rmi centos:centos8 hello-world:latest

docker run –detach –name foobar –privileged –publish=8080:80 centos:centos8 /sbin/init


- 停止したコンテナからイメージを作るときはcommitコマンド  

docker commit foobar centos:centos8


- imagesコマンドで確認  

docker images

REPOSITORY TAG IMAGE ID CREATED SIZE centos centos8 343865a610f7 58 seconds ago 1.32GB ~~~

  • End

Post Directory