在 Windows Insider 版本上使用 aws-azure-login 容器

Mar*_*ssy 0 active-directory amazon-web-services windows-10 windows-subsystem-for-linux

我一直在设置我的笔记本电脑以使用 WSL2 作为公司其他人的模型。我在创建良好的开发环境方面取得了很大进展。

\n\n
    \n
  • 我连接到 Windows Insider 程序:Version 2004 (OS Build 19035.1)
  • \n
  • 我安装了 Ubuntu 18.04 WSL 并将其升级到 WSL 2
  • \n
  • 我安装了Docker的边缘版本2.1.6.1
  • \n
\n\n

所有这些都运行良好。现在我想连接到我的公司 AWS 帐户,该帐户通过 Microsoft AD 进行身份验证。所以我下载了 aws-azure-login 容器并运行

\n\n

docker run --rm -it -v \\~/.aws:/root/.aws sportradar/aws-azure-login --configure

\n\n

...运行得非常好。

\n\n

但当我真正跑步的时候

\n\n

docker run --rm -it -v \\~/.aws:/root/.aws sportradar/aws-azure-login --configure

\n\n

...我收到此错误:

\n\n
\xe2\x9d\xaf docker run --rm -it -v \\~/.aws:/root/.aws sportradar/aws-azure-login Logging in with profile 'default'... \nUsing AWS SAML endpoint u/ ? Username: mark.chassy@virtualclarity.com ? \nPassword: \\[hidden\\] \nWe've sent a notification to your mobile device. \nPlease open the Microsoft Authenticator app to respond. Unable to recognize page state! \nA screenshot has been dumped to aws-azure-login-unrecognized-state.png. \nIf this problem persists, try running with --mode=gui or --mode=debug  \n
Run Code Online (Sandbox Code Playgroud)\n\n

当我尝试在 gui 模式下运行时:

\n\n
\xe2\x9d\xaf docker run --rm -it -v \\~/.aws:/root/.aws sportradar/aws-azure-login --mode=gui \nLogging in with profile 'default'...\nUsing AWS SAML endpoint u/ Error: Failed to launch chrome!  (chrome:15): \nGtk-WARNING \\*\\*: cannot open display:   \nTROUBLESHOOTING: https://github.com/GoogleChrome/u/in/node_modules/puppeteer/lib/Launcher.js:348:14)     \nat ChildProcess.helper.addEventListener (/aws-azure-login/node\\_modules/puppeteer/lib/Launcher.js:338:60)     \nat emitTwo (events.js:131:20)     at ChildProcess.emit (events.js:214:7)     \nat Process.ChildProcess.\\_handle.onexit (internal/child\\_process.js:198:12)\n
Run Code Online (Sandbox Code Playgroud)\n\n

当我尝试在调试模式下运行时:

\n\n
\xe2\x9d\xaf docker run --rm -it -v \\~/.aws:/root/.aws sportradar/aws-azure-login --mode=debug \nLogging in with profile 'default'... \nUsing AWS SAML endpoint \nError: Failed to launch chrome!  (chrome:15): Gtk-WARNING \\*\\*: cannot open display:   \nTROUBLESHOOTING: u/)     \nat ChildProcess.helper.addEventListener (/aws-azure-login/node\\_modules/puppeteer/lib/Launcher.js:338:60)     \nat emitTwo (events.js:131:20)     \nat ChildProcess.emit (events.js:214:7)     \nat Process.ChildProcess.\\_handle.onexit (internal/child\\_process.js:198:12)  \n
Run Code Online (Sandbox Code Playgroud)\n\n

在 powershell 或 cmd 中运行时,我得到相同的结果。另一方面,如果我在 Mac 上运行它,它运行得很好,所以我不认为容器本身有什么问题。

\n\n

有人让它在 WSL 1、WSL 2 甚至 Windows 10 上运行吗?

\n

lwp*_*ro2 5

你可以尝试这个命令

aws-azure-login --mode=gui --mode=debug --no-sandbox --enable-chrome-network-service --no-verify-ssl