Back to Blog
Swagger editor docker6/26/2023 Then, swagger UI can pick up my swagger.json as /foo/swagger.json. Version: Docker version 1.10.3, build e03ddb8/1.10.3 docker.io/swaggerapi/swagger-editor : latest Browser/OS: Fedora 24 Issue docker pull swaggerapi/swagger-editor. This command mounts my current working directory as /foo in the docker container. The important thing to note is that I have a file called swagger.json in my current working directory. By default, show the swagger file at '/foo/swagger.json'." Mount my current working directory as '/foo' in the docker container. This says in english: "Run my swagger-ui instance on port 8085. Putting it all together, I ended up with the following: docker run -p 8085:8080 -e SWAGGER_JSON=/foo/swagger.json -v `pwd`:/foo swaggerapi/swagger-ui This option says "By default, show the swagger for the file at using the docker container's file system." The important part here, is that this filepath should take into account how you set above This option says "Mount the path from my local file system within the swagger-ui docker container on path " -e SWAGGER_JSON= Ultimately, my issue was with understanding the -e SWAGGER_JSON and -v flags, so I wanted to explain them here. I found this topic because I wanted to see a visual representation of my local swagger file, but could not seem to get swagger-ui (running in docker) to display anything other than the petstore.
0 Comments
Read More
Leave a Reply. |