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

Docker DNSで詰まった話

Posted at

#DockerのDNSのせいでapt updateできない
ひとまずなぐり書きです

Dockerのコンテナで一度は詰まった方いたであろうDNS問題。
今回使用した環境

  • Nvidia Jetson nano
  • JetPack
  • Ubuntu 18.04
  • Docker

こんなところです。
いつもどおりdocker fileからbuildしようとすると。

# apt-get
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Temporary failure resolving 'archive.ubuntu.com'

直訳すると
erroネットつながってねーよバカアホカス目ついとんか
と怒られる。。。
調べるとDNSが問題みたい
Dockerfile上で

RUN echo 'nameserver 8.8.8.8' >> /etc/resolv.conf

でも良いがなんとなくブサイク
なので以下の方法で解決したよ
まずvimやらnanoやらで/etc/systemd/system/multi-user.target.wants/docker.serviceを開きます
そんでもって下の感じで--dnsのオプションを追加して対応できたぞ

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --dns 8.8.8.8
1
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
1
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?