atlassian/checkstyle-report:0.4.0 'docker' exceeded memory limit
Asked by Johann Hough:

I'm getting the following error:
> Container 'docker' exceeded memory limit.

while running the \`atlassian/checkstyle-report:0.4.0\` pipe on bitbucket pipelines.

Here is my full pipeline file:  

```
image: maven:3-openjdk-17
clone:
  depth: full              # SonarCloud scanner needs the full history to assign issues properly

definitions:
  caches:
    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build
  steps:
    - step: &build-test-analyse
        name: Build, test and analyze code
        caches:
          - maven
          - sonar
        script:
          - mvn checkstyle:checkstyle
          - mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.java.checkstyle.reportPaths=\"target/checkstyle-result.xml\"
        after-script:
          - pipe: atlassian/checkstyle-report:0.4.0

        artifacts:
          - target/**

pipelines:
  branches:
    develop:
      - step: *build-test-analyse
    integration:
      - step: *build-test-analyse
  pull-requests:
    master:
      - step: *build-test-analyse
```

And here is the end of the output log:

```
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/skins/maven-default-skin/1.3/maven-default-skin-1.3.jar (14 kB at 363 kB/s)
[INFO] Rendering content with org.apache.maven.skins:maven-default-skin:jar:1.3 skin.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 59.279 s
[INFO] Finished at: 2023-08-23T06:46:24Z
[INFO] ------------------------------------------------------------------------

+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \
--env=CI="$CI" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
--env=BITBUCKET_SSH_KEY_FILE="$BITBUCKET_SSH_KEY_FILE" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report" \
--env=BITBUCKET_EXIT_CODE="$BITBUCKET_EXIT_CODE" \
--env=CHECKSTYLE_REPORT_ID="checkstyle-1" \
--env=CHECKSTYLE_RESULT_PATTERN=".*/checkstyle-result.xml$" \
--env=REPORT_FAIL_SEVERITY="info" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/checkstyle-report:0.4.0
Unable to find image 'bitbucketpipelines/checkstyle-report:0.4.0' locally
0.4.0: Pulling from bitbucketpipelines/checkstyle-report
e7c96db7181b: Pulling fs layer
f910a506b6cb: Pulling fs layer
b6abafe80f63: Pulling fs layer
06b47ee1a37e: Pulling fs layer
9be134b68a57: Pulling fs layer
06b47ee1a37e: Waiting
9be134b68a57: Waiting
e7c96db7181b: Verifying Checksum
e7c96db7181b: Download complete
f910a506b6cb: Verifying Checksum
f910a506b6cb: Download complete
9be134b68a57: Verifying Checksum
9be134b68a57: Download complete
06b47ee1a37e: Verifying Checksum
06b47ee1a37e: Download complete
e7c96db7181b: Pull complete
f910a506b6cb: Pull complete
b6abafe80f63: Verifying Checksum
b6abafe80f63: Download complete
b6abafe80f63: Pull complete
06b47ee1a37e: Pull complete
9be134b68a57: Pull complete
Digest: sha256:f7a0526aaeeb51d4a96d9e59bc78c6c4eb03f34074abbbf423e8e8d71941b7cc
Status: Downloaded newer image for bitbucketpipelines/checkstyle-report:0.4.0
Aug 23, 2023 6:46:34 AM se.bjurr.violations.lib.ViolationsApi$1 log
INFO: Found 1 reports in /opt/atlassian/pipelines/agent/build with pattern .*(?:/|\\)checkstyle-result.xml$
Aug 23, 2023 6:46:34 AM se.bjurr.violations.lib.ViolationsApi$1 log
INFO: - /opt/atlassian/pipelines/agent/build/target/checkstyle-result.xml
time="2023-08-23T06:46:40Z" level=error msg="error waiting for container: unexpected EOF"
```


Answers:
author: Syahrul
body: Hey [@Johann Hough](/t5/user/viewprofilepage/user-id/5299202)

Welcome to the community.

The error message you've shared indicates that the memory allocated to the **docker** **service** container is insufficient.

The default memory limit for the Docker service container is 1024 MB. So the error means the services are using more than the allocated memory.

You can increase the memory allocated to the Docker service container as below.  

```
 definitions:  services:    docker:      memory: 2048
```

I hope this helps. For more information on Bitbucket container please check our page [here.](https://support.atlassian.com/bitbucket-cloud/docs/databases-and-service-containers/)

Cheers,  
Syahrul

comments: author: Johann Hough
body: This worked. Thank you for the help.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud