mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 13:47:52 +00:00
Auto-merge for PR #642 via VersionBot
Use DOCKER_HOST from env if possible, and no connection options are available
This commit is contained in:
commit
0a3123a9cf
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v6.6.2 - 2017-08-31
|
||||
|
||||
* Use DOCKER_HOST from env if possible, and no connection options are available #642 [Tim Perry]
|
||||
|
||||
## v6.6.1 - 2017-08-28
|
||||
|
||||
* Update resin-preload to 3.1.4 #650 [Alexis Svinartchouk]
|
||||
|
@ -68,8 +68,9 @@ exports.appendOptions = function(opts) {
|
||||
};
|
||||
|
||||
exports.generateConnectOpts = generateConnectOpts = function(opts) {
|
||||
var Promise, _, fs;
|
||||
var Promise, _, buildDockerodeOpts, fs;
|
||||
Promise = require('bluebird');
|
||||
buildDockerodeOpts = require('dockerode-options');
|
||||
fs = require('mz/fs');
|
||||
_ = require('lodash');
|
||||
return Promise["try"](function() {
|
||||
@ -82,6 +83,8 @@ exports.generateConnectOpts = generateConnectOpts = function(opts) {
|
||||
connectOpts.port = opts.dockerPort || 2376;
|
||||
} else if ((opts.docker != null) && (opts.dockerHost != null)) {
|
||||
throw new Error("Both a local docker socket and docker host have been provided. Don't know how to continue.");
|
||||
} else if (process.env.DOCKER_HOST) {
|
||||
connectOpts = buildDockerodeOpts(process.env.DOCKER_HOST);
|
||||
} else {
|
||||
connectOpts.socketPath = '/var/run/docker.sock';
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ exports.appendOptions = (opts) ->
|
||||
|
||||
exports.generateConnectOpts = generateConnectOpts = (opts) ->
|
||||
Promise = require('bluebird')
|
||||
buildDockerodeOpts = require('dockerode-options')
|
||||
fs = require('mz/fs')
|
||||
_ = require('lodash')
|
||||
|
||||
@ -103,8 +104,11 @@ exports.generateConnectOpts = generateConnectOpts = (opts) ->
|
||||
else if opts.docker? and opts.dockerHost?
|
||||
# Both provided, no obvious way to continue
|
||||
throw new Error("Both a local docker socket and docker host have been provided. Don't know how to continue.")
|
||||
else if process.env.DOCKER_HOST
|
||||
# If no explicit options are provided, use the env
|
||||
connectOpts = buildDockerodeOpts(process.env.DOCKER_HOST)
|
||||
else
|
||||
# None provided, assume default docker local socket
|
||||
# No options anywhere, assume default docker local socket
|
||||
connectOpts.socketPath = '/var/run/docker.sock'
|
||||
|
||||
# Now need to check if the user wants to connect over TLS
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "resin-cli",
|
||||
"version": "6.6.1",
|
||||
"version": "6.6.2",
|
||||
"description": "The official resin.io CLI tool",
|
||||
"main": "./build/actions/index.js",
|
||||
"homepage": "https://github.com/resin-io/resin-cli",
|
||||
@ -51,6 +51,7 @@
|
||||
"docker-qemu-transpose": "^0.2.2",
|
||||
"docker-toolbelt": "^1.3.3",
|
||||
"dockerode": "^2.5.0",
|
||||
"dockerode-options": "^0.2.1",
|
||||
"drivelist": "^5.0.22",
|
||||
"etcher-image-write": "^9.0.3",
|
||||
"global-tunnel-ng": "github:zvin/global-tunnel#dont-proxy-connections-to-file-sockets",
|
||||
|
Loading…
Reference in New Issue
Block a user