GithubHelp home page GithubHelp logo

bluelabs / acr-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gordonby/acr-build

0.0 0.0 0.0 6 KB

Github action to build containers with Azure Container Registry

License: MIT License

Shell 79.68% Dockerfile 20.32%

acr-build's Introduction

Build images with Azure Container Registry

This action can be used to build containers using an Azure Container Registry.

For more information about his capability, have a look at the docs tutorial.

Action capabilities

Following the capabilities of this action:

  • Custom Dockerfile path: It is possible to specify a path for the Dockerfile

  • Build context: Allows to specify the build context for the image

  • Default tag: The action will default to use the first 8 characters of the commit SHA if no tag is specified

  • Private repositories:: It is possible to use private Github repositories by providing a github_token

Action inputs:

Action inputs Description Default
dockerfile
(Optional) Path to the Dockerfile relative to `folder` ./Dockerfile
folder
(Optional) Build context for Docker agent ./
repository
(Mandatory) The repository on the Azure Container Registry
image
(Mandatory) Docker image name
tag
(Optional) Docker image tag GITHUB_SHA::8
git_access_token
(Optional) The Github access token for private repositories GITHUB_SHA::8
registry
(Mandatory) The Azure Container Registry name
build_args
(Optional) Build arguments

Example usage - Public Repository

This example builds the Azure Voting App front-end.

name: build_image
on:
 workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Azure Login
        uses: Azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: ACR build
        id: acr
        uses: azure/acr-build@v1
        with:
          registry: MyAzureContainerRegistry
          repository: azure-voting-app-redis #${{ github.repository.name }}
          image: azurevote
          folder: azure-vote

Example usage - Private Repository

In your repository, optionally create the following secrets (or set them in clear in the workflow definition):

  • git_access_token (for accessing private repositories)

In .github/workflows create a workflow file like the following:

name: build_image
on:
  push:
    paths:
      - "src/docker/**"
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Azure Login
        uses: Azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: ACR build
        id: acr
        uses: azure/acr-build@v1
        with:
          registry: MyAzureContainerRegistry
          repository: ${{ github.repository.name }}
          image: ${{ github.repository.name }}
          git_access_token: ${{ secrets.git_access_token }}
          folder: src/docker
          folder: ../../dockerfiles/Dockerfile

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

acr-build's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.