Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined 'opts' are never used on function call #32

Closed
sreuter opened this issue Jan 22, 2014 · 2 comments
Closed

User defined 'opts' are never used on function call #32

sreuter opened this issue Jan 22, 2014 · 2 comments

Comments

@sreuter
Copy link

sreuter commented Jan 22, 2014

I need to overwrite some of the default options when calling buildImage, as I want to set opts.path to '/build?t=nodeapp&q' to set a name/tag for the resulting image.

Unfortunately, the opts object given on call get completely ignored/overwritten by the defaults.

This seems to be a general problem, not only for docker.buildImage();

Docker.prototype.buildImage = function(file, opts, callback) {
  var self = this;
  var opts = {
    path: '/build?',
    method: 'POST',
    file: file,
    options: opts,
    isStream: true,
    statusCodes: {
      200: true,
      500: "server error"
    }
  };

  this.modem.dial(opts, function(err, data) {
    callback(err, data);
  });
};
@apocas
Copy link
Owner

apocas commented Jan 22, 2014

You just need to do something like this then:

docker.buildImage('./test/test.tar', {t: 'nodeapp'}, handler);

Check this: https://github.com/apocas/docker-modem/blob/master/lib/modem.js#L36

@sreuter
Copy link
Author

sreuter commented Jan 22, 2014

Uh, yay, spotted that one minute ago while digging trough the docker-modem code ;-)

Thanks anyway, this is an awesome module!

@sreuter sreuter closed this as completed Jan 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants