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 5 years have passed since last update.

Mac OSでDockerを使ってCentOS上でnginxを起動するまで

0
Last updated at Posted at 2020-09-26

nginx実践入門 をMac OSで進めたいです。

DockerでCentOSを起動

[Runtime privilege and Linux capabilities] (https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)
F.2.4. /SBIN/INIT プログラム

$ docker run --detach --name mycentos --privileged centos /sbin/init

コンテナ内でBashシェルを起動

インタラクティブなコンテナを実行

$ docker exec -it mycentos bin/bash

YUMレポジトリーの設定

9.5. YUM と YUM リポジトリーの設定
nginx: Linux packages

[root@b626534eeb51 yum.repos.d]# vi nginx.repo
nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/8/$basearch/
gpgcheck=0
enabled=1

nginxのインストールと起動

[root@b626534eeb51]# yum install nginx
[root@b626534eeb51]# nginx

[root@b626534eeb51]# systemctl enable nginx.service
[root@b626534eeb51]# systemctl start nginx.service
[root@b626534eeb51]# curl localhost
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?