简体   繁体   English

在azure管道上拉并运行Linux docker映像

[英]Pull and Run a Linux docker image on an azure pipeline

When pulling and running a Linux docker based image in AZURE PIPELINE, I get this error: "image operating system "Linux" cannot be used on this platform" 在AZURE PIPELINE中拉并运行基于Linux docker的映像时,出现以下错误:“映像操作系统“ Linux”不能在该平台上使用”

  1. I create a Linux docker image 我创建一个Linux docker映像
  2. I pushed the image to azure registry 我将图片推送到天蓝色注册表
  3. I setup the azure pipeline as follow: 我将蔚蓝管道设置如下:
    • Docker CLI Docker CLI
    • Azure CLI: Azure CLI:
    • I login to registry 我登录到注册表
    • Command Line: 命令行:
    • I do: docker pull image 我这样做:docker pull image
    • I do: docker run -it image 我这样做:docker run -it image

该图显示了Azure管道

When I run the pipeline, I get this error: "image operating system "Linux" cannot be used on this platform" 运行管道时,出现以下错误:“此平台上不能使用映像操作系统“ Linux”

Script output: 脚本输出:

2019-03-25T21:23:03.4513990Z ##[section]Starting: Command Line Script
2019-03-25T21:23:03.4616971Z ==============================================================================
2019-03-25T21:23:03.4617284Z Task         : Command Line
2019-03-25T21:23:03.4617442Z Description  : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
2019-03-25T21:23:03.4617592Z Version      : 2.146.1
2019-03-25T21:23:03.4617715Z Author       : Microsoft Corporation
2019-03-25T21:23:03.4618046Z ==============================================================================
2019-03-25T21:23:04.8241638Z Generating script.
2019-03-25T21:23:04.9020040Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\157d3a61-fe5f-46b2-b74e-1082d4532014.cmd""
2019-03-25T21:23:05.7814076Z v1: Pulling from hubb-api-tests
2019-03-25T21:23:06.2370457Z image operating system "linux" cannot be used on this platform
2019-03-25T21:23:06.2872386Z the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
2019-03-25T21:23:06.3934386Z ##[error]Cmd.exe exited with code '1'.
2019-03-25T21:23:06.4549404Z ##[section]Finishing: Command Line Script

I expect to be able to pull the image and run it on Azure DevOps pipeline since I tested the same steps on my local computer with no problems. 我希望能够提取图像并在Azure DevOps管道上运行它,因为我在本地计算机上测试了相同的步骤,没有任何问题。

Thank you so very much 非常感谢你

该图显示了带错误的脚本输出

You can only achieve this using your own windows agent configured to allow to run linux containers on windows. 您只能使用配置为允许在Windows上运行linux容器的Windows代理来实现此目的。 hosted agents wont allow that. 托管代理将不允许这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM