redocly-cli
redocly-cli copied to clipboard
Redocly CLI Hangs When Running In A Container
Describe the bug
We're using the Redocly CLI to bundle our OpenAPI specs, but for some reason it seems to hang randomly. We believe this started with Docker image redocly/cli:1.13.0
, but we're not 100% certain. For now we've snapshotted ourselves to 1.12.0.
For context, the CLI works when I install it directly with NPM or use the docker pull ... && docker run ...
commands found on your documentation. However, if I intentionally use the desktop-linux
builder in Docker Hub that's when it ends up hanging.
Unfortunately, it doesn't look like there's any way to enable debug logs with the CLI so I'm not sure if it's pausing on something related to our OpenAPI spec or if it's a genuine issue which is making it hard to determine where it's coming from.
To Reproduce To reproduce this issue on my ARM Mac, I ran the following:
- Dockerfile content:
FROM redocly/cli as bundle-spec
WORKDIR /spec
COPY . .
RUN redocly bundle --remove-unused-components --dereferenced openapi.yaml -o dist/bundled_openapi.yaml
-
export DOCKER_BUILDKIT=1
-
docker buildx create --name linuxbuilder --use
-
docker buildx inspect linuxbuilder --bootstrap
-
docker buildx build --platform linux/amd64 -t your-image-name .
Expected behavior
The spec should bundle successfully or at least error out with some sort of reason why it failed.
Logs
After running the steps above, I can see this. Notice that this step has been running for 481 seconds already (and climbing)
=> [bundle-spec 4/8] RUN redocly bundle --remove-unused-components --dereferenced openapi.yaml -o dist/bundled_openapi.yaml 481.5s
=> => # (node:1) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
=> => # (Use `node --trace-deprecation ...` to show where the warning was created)
=> => # bundling openapi.yaml...
OpenAPI description
We are using OpenAPI 3.1.0. I'm not sure if I can post my spec here so I will try to find a test example that reproduces this issue. If I do, I will post it as a comment below.
Redocly Version(s)
For the test scenario above, I'm pulling the latest which I believe is 1.16.0
Node.js
Version(s)
Using the Docker image provided by you
Additional context
N/A