dockerode
                                
                                
                                
                                    dockerode copied to clipboard
                            
                            
                            
                        buildImage from image in private registry
Hi! I can not build an image from an image in a private registry. Here is an example of my code:
Dockerfile:
FROM <any_image_in_private_registry>
index.js
var Dockerode = require('dockerode');
dockerClient = new Dockerode();
dockerClient.buildImage({
      context: __dirname,
      src: ['Dockerfile']
}, {
      t: 'imgcwd',          
      registryconfig: {
            username:"[email protected]",
            password:"xxxxxx", 
            auth:"",
            serveraddress:"privateregistry.xxxx.com:8443",
            email: '',
      }
}, function(error, output) {
      if (error) {
            return console.error(error);
      }
      output.pipe(process.stdout);
});
I get the response of ... "denied .Access forbidden".
It works with public images. Do you have any idea? Thanks!
Having same issue @ACosaLinan. Were you able to figure out a workaround?
I'm using authconfig instead of registryconfig though.
It looks like the docker engine /build endpoint does not support the X-Auth-Config header, but requires a X-Registry-Config header. Meaning the authconfig option does not have any effect for the buildImage method.
The registryconfig option does work with the following format, which is compatible with authentication to multiple registries (something desirable for a build).
registryconfig: {'https://index.docker.io/v1/': {username: 'myusername', password: '<mypass>'}}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Open a new issue if needed.