LoginSignup
0
0

More than 3 years have passed since last update.

docker をVM的に使う

Posted at

1行目でdockerのCentosイメージをダウンロードする。
2行目の /sbin/initでコンテナを起動する。(ポートフォワーディングでホストの80番とコンテナの80番ポートをリンクさせる)
3行目でコンテナが起動しているかどうかを確認。
4行目の /bin/bashでコンテナ内に入る。

docker pull centos:latest
docker run --privileged -it -d -p 80:80 --name mycent centos:latest /sbin/init
docker ps
docker exec -it mycent /bin/bash

Ubuntu1804のコンテナイメージでは/sbin/initは無いみたいで
起動しませんでした...

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