我在 Azure DevOps 中创建了一个管道来运行 Docker cirrus/flutter 映像。Azure 尝试初始化容器时发生错误(在 useradd 命令中)。以下是执行日志的最后一部分,包含错误:
##[command]/usr/bin/docker exec 5ae52fcbeefecc0df48056df5f9d673429fe5173e7a8e3d984d889ce5223c34c sh -c "command -v bash"
/bin/bash
##[command]whoami
vsts
##[command]id -u vsts
1001
Try create an user with UID '1001' inside the container.
##[command]/usr/bin/docker exec 5ae52fcbeefecc0df48056df5f9d673429fe5173e7a8e3d984d889ce5223c34c bash -c "grep 1001 /etc/passwd | cut -f1 -d:"
##[command]/usr/bin/docker exec 5ae52fcbeefecc0df48056df5f9d673429fe5173e7a8e3d984d889ce5223c34c id -u bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
id: extra operand 'warning:'
Try 'id --help' for more information.
##[command]/usr/bin/docker exec 5ae52fcbeefecc0df48056df5f9d673429fe5173e7a8e3d984d889ce5223c34c useradd -m -u 1001 vsts_azpcontainer
useradd: Permission …Run Code Online (Sandbox Code Playgroud) 每一个人.
我正在使用AbstractAccountAuthenticator实现帐户身份验证器,我需要在函数getAuthToken中调用异步方法来验证用户身份.我的代码是这样的:
public class AccountAuthenticator extends AbstractAccountAuthenticator {
...
@Override
public Bundle getAuthToken( final AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options )
throws NetworkErrorException
{
final AccountManager accountManager = AccountManager.get(context);
String authToken = accountManager.peekAuthToken( account, authTokenType );
// !!!!
if( TextUtils.isEmpty(authToken) ) {
<<call asynchronous method to acquire token>>
return null;
}
// !!!!
final Bundle result = new Bundle();
result.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);
result.putString(AccountManager.KEY_ACCOUNT_TYPE, account.type);
result.putString(AccountManager.KEY_AUTHTOKEN, authToken);
return result;
}
...
}
Run Code Online (Sandbox Code Playgroud)
根据Google的'getAuthToken'方法文档:它返回一个Bundle结果,如果要通过响应返回结果,则返回null.结果将包含两种:
• AccountManager.KEY_INTENT或
• AccountManager.KEY_ACCOUNT_NAME …