-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding SWAGGER_JSON and URL does not work for Docker distribution #5213
Comments
I have met with the same problem... |
same problem |
I think the problem is #5199 because it gzip's the nginx-bundled Basically the idea of "optimizing" html file on build does not make sense if there are some generated html files on runtime as well. |
Regression! 😱 We'll ship a fix for this ASAP, probably later today. |
The gzipping should simply happen in the shell init script on runtime. I'd PR' it myself; but I won't be able to do so before the weekend... |
Fixed! We've updated our I'm also going to build out a small integration test suite that pulls down a real Docker image and checks it for env var configuration effectiveness, so that we automatically catch this in our releases going forward. Apologies for the disruption! |
Is it actually fixed? I seem to observe the same behaviour as described in the first post with setting SWAGGER_JSON, (running on Windows, though). |
@anuras, should be - can you make sure you're pulling a fresh image from Docker Hub? We overwrote existing tags to fix this, so you might have an old cached version locally. |
you should use API_URL, not SWAGGER_JSON. |
I have a swagger.json on my desktop, so running this command worked:
|
Context
SWAGGER_JSON environment variable ignored by Docker deployment
The Docker build of swaggerapi/swagger-ui does not work when overriding the SWAGGER_JSON with a mounted file as documented in https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/installation.md.
run.sh updates the nginx index.html if a mounted file $SWAGGER_JSON exists.
Problem is that the base image used by swaggerapi/swagger-ui - FROM nginx:1.15-alpine - has a index.html.gz file which takes precedence over the index.html, so the updated index.html is ignored.
To reproduce:
Have your swagger.json in /bar
docker pull swaggerapi/swagger-ui
docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo swaggerapi/swagger-ui
Access swagger-ui @ http:///
Will see petstore, not your swagger.json.
URL environment variable ignored by Docker deployment
To reproduce:
Have your swagger.json in http:///swagger.json
docker pull swaggerapi/swagger-ui
docker run -p 80:8080 -e URL="http:///swagger.json" swaggerapi/swagger-ui
Access swagger-ui @ http:///
Will see petstore, not http:///swagger.json.
The text was updated successfully, but these errors were encountered: