LoginSignup
0
0

More than 3 years have passed since last update.

python簡易Webサーバーをdockerコンテナー構築

Posted at

Base Docker Image

今回は、「centos/sysctct」 imageをBaseにした。

1. docker images 確認

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
centos/systemd      latest              05d3c1e2d0c1        7 weeks ago         202MB

2. docker images 起動

$ docker run -d 05d3c1e2d0c
0bdf202c5dcbad38df131860681ca5aa604b46ded37837b3a6c18f56665a6871
$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
0bdf202c5dcb        05d3c1e2d0c1        "/usr/sbin/init"    8 seconds ago       Up 7 seconds                            sleepy_tu

3. コンテナへログイン

$ docker exec -it 0bdf202c5dcb bash
[root@0bdf202c5dcb /]#

4. 各種設定等

確認

[root@0bdf202c5dcb ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

[root@0bdf202c5dcb ~]# uname -a
Linux 0bdf202c5dcb 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
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