app/Services/DockerService.php
public function login($username, $password, $server = null) {

		$this->requireProcess();

		$commandArguments = [
            'docker',
            'login',
            '-u',
            $username,
            '--password-stdin'
		];
		if( !empty($server) )
			$commandArguments[] = $server;
		$process = ProcessBuilder::create( $commandArguments )
			->setTimeout(null)->getProcess();
        $process->setInput($password);

		$this->processHelper->run($this->output, $process, null, null, OutputInterface::VERBOSITY_VERY_VERBOSE);

		if($process->getExitCode() !== 0)
			throw new LoginFailedException("Login failed", 21);
	}
public function login($username, $password, $server = null) {

		$this->requireProcess();

		$commandArguments = [
            'docker',
            'login',
            '-u',
            $username,
            '--password-stdin'
		];
		if( !empty($server) )
			$commandArguments[] = $server;
		$process = ProcessBuilder::create( $commandArguments )
			->setTimeout(null)->getProcess();
        $process->setInput($password);

		$this->processHelper->run($this->output, $process, null, null, OutputInterface::VERBOSITY_VERY_VERBOSE);

		if($process->getExitCode() !== 0)
			throw new LoginFailedException("Login failed", 21);
	}
public function login ( $ username , $ password , $ server = null ) { $ this -> requireProcess ( ) ; $ commandArguments = [ 'docker' , 'login' , '-u' , $ username , '--password-stdin' ] ; if ( ! empty ( $ server ) ) $ commandArguments [ ] = $ server ; $ process = ProcessBuilder :: create ( $ commandArguments ) -> setTimeout ( null ) -> getProcess ( ) ; $ process -> setInput ( $ password ) ; $ this -> processHelper -> run ( $ this -> output , $ process , null , null , OutputInterface :: VERBOSITY_VERY_VERBOSE ) ; if ( $ process -> getExitCode ( ) !== 0 ) throw new LoginFailedException ( "Login failed" , 21 ) ; }
login to Dockerhub using the given username and password

@param $username
@param $password
@param string|null $server
login to Dockerhub using the given username and password