Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Conversation

@jb-adams
Copy link
Member

Dockerfile to execute docs build in CI via docker container. Currently registered on docker hub

@jb-adams jb-adams linked an issue Jan 17, 2022 that may be closed by this pull request
@jb-adams
Copy link
Member Author

solution for #82

@jb-adams jb-adams requested review from jaeddy and tschaffter January 17, 2022 16:47
@tschaffter
Copy link
Collaborator

@jb-adams This is a nice way to build the to dockerize the image.

  • I can successfully build the image with make docker-build

  • I can see the help menu

    $ docker run -it --rm ga4gh/gh-openapi-docs:0.2.2-rc3 --help
    Usage: bundle [options]
    
    Options:
      -V, --version         output the version number
      -c --config <config>  Path to local configuration options [default: ".spec-docs.json"] (default: ".spec-docs.json")
      -d --dry-run [bool]   Do not touch or write anything, but show the commands (default: false)
      -v --verbose [bool]   Verbose output (default: false)
      -h, --help            output usage information

I tried to run the tool using the following command but without success. Do you see what I may doing wrong? Adding an example to the README could help.

$ docker run -it --rm -v ${PWD}:/project \
>   ga4gh/gh-openapi-docs:0.2.2-rc3 \
>     --dry-run true \
>     -c /project/.spec-docs.json.sample.2
node:internal/validators:119
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:119:11)
    at Object.join (node:path:1172:7)
    at constructBranchPath (webpack:///./src/lib/config.js?:40:56)
    at eval (webpack:///./src/lib/config.js?:45:15)
    at Module../src/lib/config.js (/snapshot/dist/bundle.js)
    at __webpack_require__ (/snapshot/dist/bundle.js)
    at eval (webpack:///./src/lib/tasks.js?:3:65)
    at Module../src/lib/tasks.js (/snapshot/dist/bundle.js)
    at __webpack_require__ (/snapshot/dist/bundle.js) {
  code: 'ERR_INVALID_ARG_TYPE'
}

where I replaced the content of /project/.spec-docs.json.sample.2 so that the value of apiSpecPath starts with the name of the docker volume I'm mounting (/project).

{
    "buildPages": [
        {
            "apiSpecPath": "/project/test/test-spec/combined/openapi.yaml",
            "htmlOutfile": "index.html",
            "yamlOutfile": "openapi.yaml",
            "jsonOutfile": "openapi.json"
        }
    ],
    "redocTheme": "ga4gh"
}

@tschaffter
Copy link
Collaborator

An improvement would be to run the tool as a non-root user, e.g. using gosu.

@tschaffter
Copy link
Collaborator

@jb-adams I'm having an issue running the dockerized tool (see above). Do you know what the issue may be?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockerize gh-openapi-docs

2 participants