Skip to content

Build DevDocs with Docker

hguthrie edited this page Apr 16, 2021 · 3 revisions

Docker provides a quick and easy way to build and preview the documentation. You do not need to install Ruby dependencies manually. This Docker solution launches Jekyll inside the container in watch mode.

Every change of a markdown file automatically triggers a rebuild of the documentation.

  1. Install Docker. If you have Docker installed, launch the Docker application.

  2. Clone the DevDocs repository.

  3. Change to the devdocs directory.

  4. Build and start the Docker environment.

    docker-compose up
    
  5. Use the server address URL provided by the system response.

    For example:

    jekyll_1  |     Server address: http://127.0.0.1:4000/
    jekyll_1  |   Server running... press ctrl-c to stop.
    
  6. Press Ctrl+C in the serve terminal to stop the server.

Access the container

To access the container command line:

  1. While the server is running, open a new terminal and change to the devdocs directory.

  2. Find and copy your container ID.

    docker ps
    
  3. Access the container's /srv/jekyll # shell in interactive mode using your container ID.

    docker exec -it <container-id> /bin/sh
    
  4. Run a check utility to test your Markdown.

    /srv/jekyll # rake check:mdl
    

    See the Testing topic for more utilities.

  5. Use exit to close the interactive shell.

NOTE: The DevDocs project uses custom rake tooling and plugins that may not be supported in the Docker image.