azure-static-web-app

I am getting Docker limit error deploying angular app to azure app service


I am deploying my angular app to Azure Static web app using bitbucket pipelines.

I followed this Microsoft documentation:https://learn.microsoft.com/en-us/azure/static-web-apps/bitbucket?tabs=angular

I do every step mention in document but I got below error:

Container 'docker' exceeded memory limit.

below is my yml file:

pipelines:
  branches:
   main:
    - step: 
        name: Deploy to test
        deployment: test
        script:
          - chown -R 165536:165536 $BITBUCKET_CLONE_DIR
          - pipe: microsoft/azure-static-web-apps-deploy:main
            variables:
                APP_LOCATION: '$BITBUCKET_CLONE_DIR'
                OUTPUT_LOCATION: '$BITBUCKET_CLONE_DIR/dist/angular-basic'
                API_TOKEN: $deployment_token

Solution

  • Container 'docker' exceeded memory limit.

    Bitbucket provides a default of 1 GB for operations in Pipelines, which is insufficient for an Angular build.

    Refer this Documentation to learn more about Docker memory limit.

    To avoid the Docker memory limit issue, increase the Docker memory size and set the pipeline step to run with size: 2x in the Bitbucket YAML file.

    definitions:
      services:
       docker:
        memory: 7168
    name: Deploy to Azure Static Web App
    size: 2x
    

    bitbucket-pipelines.yml:

    definitions:
      services:
        docker:
          memory: 7168
    pipelines:
      branches:
        main:
          - step:
              name: Deploy to Azure Static Web App
              size: 2x 
              deployment: test
              services:
                - docker 
              script:
                - chown -R 165536:165536 $BITBUCKET_CLONE_DIR
                - pipe: microsoft/azure-static-web-apps-deploy:main
                  variables:
                    APP_LOCATION: '$BITBUCKET_CLONE_DIR'
                    OUTPUT_LOCATION: '$BITBUCKET_CLONE_DIR/dist/my-angular-app/browser'
                    API_TOKEN: $deployment_token
    

    Azure Output: enter image description here