2014-10-30 3 views
1

Я использовал докер, и этот докер произошел со мной на solrcloud. Каждый для solr создает мост docker0 на IP. Например; это ip: 172.17.47.5. Но, я хочу, чтобы эта ips понравилась 192.168.2.x. Я могу вам помочь?Docker bridge change docker0 и внутренний ip

+0

Чтобы сделать ваш контейнер доступным, просто запустите контейнер с указанным портом. Напр. «docker run -d --port 3000: 3000 webapp» ваш контейнер теперь можно обнаружить, указав на hostIp: 3000 –

ответ

1

Это не так легко понять ваш вопрос, но если я прав, то вам просто нужно использовать --ip параметр при вызове Docker бежать, как описано здесь: https://docs.docker.com/reference/commandline/cli/#run

+0

Я пробую «sudo docker run --ip = 0.0.0.0 ubuntu: 14.04« Я думаю, что не получил »- -ip ". Я видел терминал и те; Использование: докерный запуск [ОПЦИИ] ИЗОБРАЖЕНИЕ [КОМАНДА] [ARG ...] Выполнить команду в новом контейнере -a, --attach = [] Прикрепить к stdin, stdout или stderr. -c, --cpu-shares = 0 Доля процессора (относительный вес) --cidfile = "" Запись идентификатора контейнера в файл --cpuset = "" Процессоры, в которых разрешено выполнение (0-3, – can

-1

Старается команда line "sudo docker run --ip = 192.168.2.35 ubuntu: 14.04". Я думаю, что у меня нет тега «-ip». Я тоже видел терминал;

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] 

Run a command in a new container 

    -a, --attach=[]   Attach to stdin, stdout or stderr. 
    -c, --cpu-shares=0   CPU shares (relative weight) 
    --cidfile=""    Write the container ID to the file 
    --cpuset=""    CPUs in which to allow execution (0-3, 0,1) 
    -d, --detach=false   Detached mode: Run container in the background, print new container id 
    --dns=[]     Set custom dns servers 
    --dns-search=[]   Set custom dns search domains 
    -e, --env=[]    Set environment variables 
    --entrypoint=""   Overwrite the default entrypoint of the image 
    --env-file=[]    Read in a line delimited file of ENV variables 
    --expose=[]    Expose a port from the container without publishing it to your host 
    -h, --hostname=""   Container host name 
    -i, --interactive=false Keep stdin open even if not attached 
    --link=[]     Add link to another container (name:alias) 
    --lxc-conf=[]    (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1" 
    -m, --memory=""   Memory limit (format: <number><optional unit>, where unit = b, k, m or g) 
    --name=""     Assign a name to the container 
    --net="bridge"    Set the Network mode for the container 
           'bridge': creates a new network stack for the container on the docker bridge 
           'none': no networking for this container 
           'container:<name|id>': reuses another container network stack 
           'host': use the host network stack inside the contaner. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure. 
    -P, --publish-all=false Publish all exposed ports to the host interfaces 
    -p, --publish=[]   Publish a container's port to the host 
           format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort 
           (use 'docker port' to see the actual mapping) 
    --privileged=false   Give extended privileges to this container 
    --rm=false     Automatically remove the container when it exits (incompatible with -d) 
    --sig-proxy=true   Proxify all received signal to the process (even in non-tty mode) 
    -t, --tty=false   Allocate a pseudo-tty 
    -u, --user=""    Username or UID 
    -v, --volume=[]   Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container) 
    --volumes-from=[]   Mount volumes from the specified container(s) 
    -w, --workdir=""   Working directory inside the container