AWS EC2「CentOS7」DockerコンテナにNginxインストールしてみる【エラー発生問題未解決】

スポンサーリンク

AWS EC2「CentOS7」DockerコンテナにNginxインストールしてみます。

Amazonマシンイメージ

「CentOS 7 (x86_64) – with Updates HVM」

AmazonEC2で作成した「CentOS7」でDockerコンテナ起動

AmazonEC2で作成した「CentOS7」にPuTTYを使用し接続。ターミナルウインドウを表示。

一般ユーザーからroot権限に切り替え、その後、

[root@localhost ~]# docker exec -it {CONTAINER_ID} /bin/bash

上記のコマンドで、作成したDockerコンテナ「704c9307ccb0」に接続して操作を行います。

Dockerコンテナ「704c9307ccb0」に接続後、Nginxのリポジトリ情報を登録するために、

[root@704c9307ccb0 /]# vi /etc/yum.repos.d/nginx.repo

上記のコマンドを入力し、ENTERキーを押してviエディタを起動し、インサートモードにきりかえて、

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1

上記のようにコードを記述し、保存して終了します。

終了後、

[root@704c9307ccb0 /]#yum -y install nginx

yumでnginxのインストールを行ってみます。

http://nginx.org/packapes/mainline/centos/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404-Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

yum-errors - CentOS Wiki

If above article doesn’t help to resolve this issue please use https://bugs.centos.org/.

One of the configured repositories failed (nginx repo),
and yum doesn’t have enough cached data to continue.At this point the only
safe thing yum can do is fail.There are a few ways to work “fix” this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum –disablerepo=nginx …

4.Disable the repository permanently, so yum won’t use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use –enablerepo for temporary usage:

yum-config-manager –disable nginx
or
subscription-manager repos –disable=nginx

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo.when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower).If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager –save –setopt=nginx.skip_if_unavailable=true

failure: repodata/repomd.xml from nginx: [Errno 256] No more mirrors to try.

[Errno 14] HTTP Error 404-Not Found

インストールが開始されますが、「http://nginx.org/packapes/mainline/centos/7/x86_64/repodata/repomd.xml:[Errno 14] HTTPエラー404-見つかりません」という、HTTPエラー404が発生する。また「nginxからのrepodata / repomd.xml:[Errno 256]これ以上試すミラーはありません。」という他のエラーも発生している模様なので、これを解決できず、今後解決法を見つけたいと思う。

コメント

タイトルとURLをコピーしました