LoginSignup
4
3

More than 5 years have passed since last update.

LXCコンテナからのgit cloneでハマるの巻

Last updated at Posted at 2014-12-15

Github からcloneするときにSSLエラーが出る。

※自分への戒め。安易に責任を他に求めてはダメというネタ。

新しく卸したサーバーにおいて、複数の人間が触ることが判明したので、
ファイルの削除にrmコマンドは「使用出来ない様に仕様変更しよう」
と思った今日この頃。環境はLXCコンテナのCentOSです。

trash-cliを使ってrmコマンドをゴミ箱に置き換える方法を採用する事に。

git clone https://github.com/andreafrancia/trash-cli.git

fatal: unable to access
~~
Failed connect to github.com:443

Oh...繋がらない。

エラーメッセでぐぐると
GitのSSL検証を無効にすれば正常にupdate出来る。
を試してみるけど違うっぽい。

gitでSSL証明書チェックをしない設定して試すとか

git config --global http.sslVerify false

# vim ~/.gitconfig

[http]
    sslVerify = false

SSL証明書のチェックをスキップすらしない^^

gitプロトコルを強制的にhttpに変更

# vim ~/.gitconfig

[url "git@github.com:"]
  insteadOf = git://github.com/
  insteadOf = https://github.com/
  insteadOf = http://github.com/

接続できない風のメッセージにチェンジ。

もしや名前解決出来てないとかー

# less /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4

# dig github.com

問題無

# traceroute github.com
traceroute to github.com (192.30.252.131), 30 hops max, 60 byte packets

?あら?まさか

# route

192.0.0.0     *               255.255.0.0   U     0      0        0 eth1

うほっ^w^
192.30.252.131がローカルIP扱い

ホスト側で

# vim /var/lib/lxc/vmxxxxx/config

configに次の行を追加

lxc.network.ipv4 = xxx.xxx.xxx.xxx/prefix_length

prefix_lengthにnetmaskをしかと入れてコンテナの再起動で完。

これで小一時間ハマるとか。死んだ方が良いと思った。
いや死なんけど。

4
3
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
4
3