docker桥改变docker和内部IP

我曾经是docker工人,这个docker工人出现在solrcloud上。每个solr在IP上创builddocker0桥。 这个ip:172.17.47.5。 但是,我想这个ips像192.168.2.x. 我能帮你吗?

理解你的问题并不那么容易,但是如果我是正确的,当你调用你的docker run时,你只需要使用–ip参数,如下所示: https : //docs.docker.com/reference/命令行/ CLI /#运行

我试试命令行“sudo docker run –ip = 192.168.2.35 ubuntu:14.04”。 我觉得还没有“–ip”标签。我也看到了terminal。

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 (eg 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