Skip to content

mdbook serve doesn't work in Docker #2102

@DKozachenko

Description

@DKozachenko

Problem

Hello, my idea was to change files on host machine, then it will changes files in container and rebuild docs. And of cource, there will be port exposing to open docs on host machine in browser.
I created Docker file and run container. It didn't work. I checked up, that files, that were changed on my machine, were changed in container and vice versa. According logs md serve didn't respond to changes.
I'm only begginer, so don't rule out the option, that I did smth wrong.

Steps

Dockerfile

FROM ubuntu
RUN apt-get update && apt-get install -y curl tar
RUN curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=/bin
COPY /docs /docs

Commads:

  • docker build -f docker/Dockerfile.local.docs -t docs-local-image .
  • docker run -dp 45000:45000 -w /docs -v "$(pwd)/docs:/docs" --name docs-local docs-local-image sh -c "mdbook serve -n 0.0.0.0 -p 45000"

Possible Solution(s)

Mb it's Docker bug?

Notes

Host OS: Windows 10
Docker version: 24.0.2

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: A bug, incorrect or unintended behaviorCommand-serveCommand: serveCommand-watchCommand: watch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions