I'm trying to login to docker using exec-maven-plugin but it is throwing unauthorized error here is the script from pom.xml

                <!-- Login to DockerHub -->
                <execution>
                    <id>docker-login</id>
                    <phase>install</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>docker</executable>
                        <workingDirectory>${project.basedir}</workingDirectory>
                        <arguments>
                            <argument>login</argument>
                            <argument>-u</argument>
                            <argument>${docker.userName}</argument>
                            <argument>-p</argument>
                            <argument>${docker.password}</argument>
                            <argument>${docker.url}</argument>
                        </arguments>
                    </configuration>
                </execution>

this script was working fine earlier but it is throwing error now. If I do login from command prompt with the same command it is working fine

docker.url is https://index.docker.io/v1/

I'm not getting any idea why it is not working with script

NOTE: Username and password is correct and it is working when logged in from web and also when we logged in from cmd.

0

There are 0 best solutions below