Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change ip address for docker

Tags:

linux

docker

I have a problem with docker: I try to create a container but when I execute

docker run -i -t base /bin/bash   # everything doing good 
aptitude update

I'm getting this error message:

Temporary failure resolving 'archive.ubuntu.com'

I try to change the IP address of docker0 but all time I fail.

The IP address on my linux

 docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 7a:3c:fa:08:73:94 brd ff:ff:ff:ff:ff:ff
    inet 172.16.42.1

My resolv.conf:

# Generated by NetworkManager
nameserver 213.244.0.15
nameserver 213.244.0.16
nameserver 8.8.8.8
like image 343
zyriuse Avatar asked Mar 24 '23 05:03

zyriuse


1 Answers

from https://github.com/dotcloud/docker/issues/866#issuecomment-19218300:

You could try to reset all the networking/iptables:

pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d

It will force docker to recreate the bridge and reinit all the network rules.

like image 64
Andy Avatar answered Apr 02 '23 08:04

Andy