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でLinuxと戯れてみたい

Posted at

Dockerを使ってLinuxと戯れたい

※自分用の備忘録です
virtualboxを使ってubuntuを入れてみようかと思いましたが、新しくvirtualboxを入れるのもなぁ...
前に少し勉強したdockerがmacにはインストール済みなので、こちらでlinuxをさわれば良いのではないかと。
dockerでlinux環境を作ってdockerで入れたlinuxにnginxとかを入れるのってそのままnginxを入れるのか。
それとも仮想linuxにnginxを入れた方がよいのかの良し悪しは不明。

dockerのバージョン

Docker version 20.10.6, build 370c289

Ubuntuの実行

# docker pull ubuntu →runコマンドにてプルまで実行してくれるため省略
docker run ubuntu

コンテナの起動

# コンテナ名がmylinuxで作成
docker run -it -d --name mylinux ubuntu

ubuntuの操作

docker exec -it mylinux /bin/bash

ubuntuの画面

root@XXXXXXXXXXXX:/# 

戯れる

パッケージが最小限?しかないようなのでupdateして入れたいものをインストールしていく

root@XXXXXXXXXXXX:/# apt update
root@XXXXXXXXXXXX:/# apt install vim ...

抜け出す

exit

コンテナの停止

docker stop mylinux

コンテナの起動

docker start mylinux
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?