@@ -75,6 +75,7 @@ type Config struct {
7575 Path string
7676 Version string
7777 Environment []string // environment variables to pass to the plugin in key=value format
78+ DockerAuth string
7879}
7980
8081type Client struct {
@@ -98,6 +99,7 @@ type Client struct {
9899 authToken string
99100 teamName string
100101 licenseFile string
102+ dockerAuth string
101103}
102104
103105// typ will be deprecated soon but now required for a transition period
@@ -144,6 +146,7 @@ func NewClient(ctx context.Context, typ PluginType, config Config, opts ...Optio
144146 metrics : & Metrics {},
145147 registry : config .Registry ,
146148 cqDockerHost : DefaultCloudQueryDockerHost ,
149+ dockerAuth : config .DockerAuth ,
147150 }
148151 for _ , opt := range opts {
149152 opt (c )
@@ -179,7 +182,7 @@ func (c *Client) downloadPlugin(ctx context.Context, typ PluginType) error {
179182 if imageAvailable , err := isDockerImageAvailable (ctx , c .config .Path ); err != nil {
180183 return err
181184 } else if ! imageAvailable {
182- return pullDockerImage (ctx , c .config .Path , c .authToken , c .teamName )
185+ return pullDockerImage (ctx , c .config .Path , c .authToken , c .teamName , c . dockerAuth )
183186 }
184187 return nil
185188 case RegistryCloudQuery :
@@ -215,7 +218,7 @@ func (c *Client) downloadPlugin(ctx context.Context, typ PluginType) error {
215218 if imageAvailable , err := isDockerImageAvailable (ctx , path ); err != nil {
216219 return err
217220 } else if ! imageAvailable {
218- return pullDockerImage (ctx , path , c .authToken , c .teamName )
221+ return pullDockerImage (ctx , path , c .authToken , c .teamName , "" )
219222 }
220223 return nil
221224 }
@@ -269,6 +272,7 @@ func (c *Client) startDockerPlugin(ctx context.Context, configPath string) error
269272 if err != nil {
270273 return fmt .Errorf ("failed to create Docker client: %w" , err )
271274 }
275+ cli .NegotiateAPIVersion (ctx )
272276 pluginArgs := c .getPluginArgs ()
273277 config := & container.Config {
274278 ExposedPorts : nat.PortSet {
0 commit comments