## yang-swagger made into a docker-container
129
This container can be used to build a Swagger2.0 (OpenAPI2.0) model out of a YANG model
FROM node:9.11.2-alpine
MAINTAINER RajR
RUN export PATH="$PATH:$(npm config get prefix)/lib/node_modules/bin" \
&& npm install -g yang-swagger
USER node
ENV HOME /home/node
WORKDIR /models
CMD ["yang-swagger"]
Keep the YANG files in the current dir, $(pwd). set YANG_MODELS to the list of YANG files in the model to be built.
$ ls
hello-world.yang
$ export YANG_MODELS="hello-world.yang "
$ docker run -it --rm --volume $(pwd):/app -w /app rajr/yang-swagger yang-swagger -f yaml -o swagger.yaml ${YANG_MODELS}
WARNING: No configurations found in configuration directory:/app/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
$ ls
hello-world.yang swagger.yaml
Content type
Image
Digest
Size
22.9 MB
Last updated
about 8 years ago
docker pull rajr/yang-swagger