mirror of https://github.com/docker/docs.git
Merge pull request #1839 from docker/fix-windows
Fix windows connection setup and port publish
This commit is contained in:
commit
21f605a4ee
|
|
@ -35,11 +35,7 @@ var DockerUtil = {
|
||||||
if (ip.indexOf('local') !== -1) {
|
if (ip.indexOf('local') !== -1) {
|
||||||
try {
|
try {
|
||||||
if (util.isWindows()) {
|
if (util.isWindows()) {
|
||||||
this.client = new dockerode({
|
this.client = new dockerode({socketPath: '//./pipe/docker_engine'});
|
||||||
protocol: 'http',
|
|
||||||
host: ip,
|
|
||||||
port: 2375
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.client = new dockerode({socketPath: '/var/run/docker.sock'});
|
this.client = new dockerode({socketPath: '/var/run/docker.sock'});
|
||||||
}
|
}
|
||||||
|
|
@ -157,7 +153,10 @@ var DockerUtil = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!containerData.HostConfig || (containerData.HostConfig && !containerData.HostConfig.PortBindings)) {
|
if (!containerData.HostConfig || (containerData.HostConfig && !containerData.HostConfig.PortBindings)) {
|
||||||
containerData.PublishAllPorts = true;
|
if (!containerData.HostConfig) {
|
||||||
|
containerData.HostConfig = {};
|
||||||
|
}
|
||||||
|
containerData.HostConfig.PublishAllPorts = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image.Config.Cmd) {
|
if (image.Config.Cmd) {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ export default {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
router.get().transitionTo('setup');
|
router.get().transitionTo('setup');
|
||||||
docker.setup(util.isWindows() ? 'docker.local':'localhost');
|
docker.setup('localhost');
|
||||||
setupServerActions.started({started: true});
|
setupServerActions.started({started: true});
|
||||||
this.simulateProgress(20);
|
this.simulateProgress(20);
|
||||||
metrics.track('Native Setup Finished');
|
metrics.track('Native Setup Finished');
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ module.exports = {
|
||||||
if (this.native === null) {
|
if (this.native === null) {
|
||||||
if (this.isWindows()) {
|
if (this.isWindows()) {
|
||||||
this.native = http.get({
|
this.native = http.get({
|
||||||
url: `http:////./pipe/docker_engine/v1.23/version`
|
url: `http:////./pipe/docker_engine/version`
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
if (response.statusCode !== 200 ) {
|
if (response.statusCode !== 200 ) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue