Azure pipeline – Build anaimage –


原文 読了までの所要時間: 4 分

Azure Pipelines

Azure Pipelines can be used to build images for any repository containing a Dockerfile. Building of both Linux and Windows containers is possible based on the agent platform used for the build.
LinuxやWindowsコンテナのビルドは、agent platformによってのみ可能となる。

Get the code

Fork the following repository containing a sample application and a Dockerfile:

Create pipeline with build step

  • Sign in to your Azure DevOps organization and navigate to your project.

  • Go to Pipelines, and then select New Pipeline.

  • Select GitHub as the location of your source code and select your repository.

You might be redirected to GitHub to sign in. If so, enter your GitHub credentials. You might be redirected to GitHub to install the Azure Pipelines app. If so, select Approve and install.
もしGitHubのサインイン画面に遷移した場合は、あなたの認証情報を入力してください。Azure PipeLines appのインストール画面に遷移した場合は、承認し、インストールしてください。

  • Select Starter pipeline. In the Review tab, replace the contents of azure-pipelines.yml with the following snippet –
    Pipeline Startを選択肢、以下のコードスニペッドにしたがって、YMLファイルを置き換えてください。
  • Select Save and run, after which you’re prompted for a commit message as Azure Pipelines adds the azure-pipelines.yml file to your repository. After editing the message, select Save and run again to see the pipeline in action.

Windows container images

Windows container images can be built using either Microsoft hosted Windows agents or Windows platform based self-hosted agents (all Microsoft hosted Windows platform based agents are shipped with Moby engine and client needed for Docker builds).
WindowsはMicrosoft hosted Windows agentsかWindows Platformbased self-hosted agentsでイメージのビルドが行えます。


BuildKit introduces build improvements in the areas of performance, storage management, feature functionality, and security. To enable BuildKit based docker builds, set the DOCKER_BUILDKIT variable as shown in the following snippet:
BuildKitを基礎に Dockerをビルドするためには、DOCKER_BUILDKIT変数に以下のスニペッドを入れる必要があります。



メールアドレスが公開されることはありません。 * が付いている欄は必須項目です