We received a Pull Request to add Swagger support to document the Docker API, and @proppy asked if we could make sure we could load the schema in a standard json schema loader, for example gojsonschema
The answer is no, not yet – but we’ll work towards it 🙂
But to find out, I added 3 files, a Dockerfile:
FROM golang:onbuild
a Makefile:
default:
docker build -t loadschema .
docker run --rm loadschema
and a tiny 13 line go program:
package main
import (
"github.com/xeipuuv/gojsonschema"
)
func main() {
_, err := gojsonschema.NewJsonSchemaDocument("file:///go/src/app/docker-v1.14.json")
if err != nil {
panic(err.Error())
}
}
The golang:onbuild
image has ONBUILD instructions to COPY the current context, download the dependencies, build the code, and then sets that application as the default CMD.
AWE.