redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

Unclear how to lint and bundle with Docker image

Open TeaDrinkingProgrammer opened this issue 8 months ago • 1 comments

I want to lint, then bundle my OpenAPI file, as described here. The problem is that I use the Redocly Docker image, and when I use the described method, the command exits after it validates succesfully:

build-openapi-bundle-1  | No configurations were provided -- using built in recommended configuration by default.
build-openapi-bundle-1  | 
build-openapi-bundle-1  | validating openapi/openapi.yml...
build-openapi-bundle-1  | openapi/openapi.yml: validated in 96ms
build-openapi-bundle-1  | 
build-openapi-bundle-1  | Woohoo! Your API description is valid. 🎉
build-openapi-bundle-1  | 
build-openapi-bundle-1 exited with code 0

The docker-compose.yml:

build-openapi-bundle:
    image: redocly/cli
    volumes:
      - .:/data
    working_dir: /data
    command: lint ./openapi/openapi.yml && bundle ./openapi/openapi.yml --output openapi-bundle.yml

How do I use the flow described in the docs with Docker?

TeaDrinkingProgrammer avatar Apr 24 '25 10:04 TeaDrinkingProgrammer

Hi @TeaDrinkingProgrammer , Could you please try to split lint and bundle into two separate services. Smth like

  lint-openapi:
    image: redocly/cli
    volumes:
      - .:/data
    working_dir: /data
    command: lint ./openapi/openapi.yml
  bundle-openapi:
    image: redocly/cli
    volumes:
      - .:/data
    working_dir: /data
    command: bundle ./openapi/openapi.yml --output openapi-bundle.yml

DmitryAnansky avatar May 02 '25 15:05 DmitryAnansky

Closing because of a lack of response, we may assume this answered the question.

adamaltman avatar Sep 02 '25 22:09 adamaltman