Livereload not working (my-fault) #41

Open
opened 2025-11-20 04:15:10 -05:00 by saavagebueno · 3 comments
Owner

Originally created by @uumami on GitHub (Feb 8, 2024).

So I have tried to get the livereload to develop the site live.
My Dockerfile:

FROM ruby:3.1-slim-bullseye as jekyll

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    git \
    && rm -rf /var/lib/apt/lists/*

# used in the jekyll-server image, which is FROM this image
COPY docker-entrypoint.sh /usr/local/bin/

RUN gem update --system && gem install jekyll && gem cleanup

EXPOSE 4000
EXPOSE 35729

WORKDIR /site

ENTRYPOINT [ "jekyll" ]

CMD [ "--help" ]

# build from the image we just built with different metadata
FROM jekyll as jekyll-serve
COPY . /site 
RUN bundle install --retry 5 --jobs 20
RUN bundle exec jekyll build

# on every container start, check if Gemfile exists and warn if it's missing
ENTRYPOINT [ "docker-entrypoint.sh" ]

CMD [ "bundle", "exec", "jekyll", "serve","--livereload-min-delay", "10" ,"--open-url","--force_polling", "-H", "0.0.0.0", "-P", "4000" ]

Docker-command with output

[uumami@magi uumami.github.io]$  docker run --rm -it --network host -v /home/uumami/uumami/uumami.github.io/:/app uumami:page
Bundle complete! 6 Gemfile dependencies, 46 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details
Configuration file: /site/_config.yml
 Theme Config file: /site/_config.yml
            Source: /site
       Destination: /site/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 0.303 seconds.
 Auto-regeneration: enabled for '/site'
LiveReload address: http://0.0.0.0:35729
    Server address: http://0.0.0.0:4000/
  Server running... press ctrl-c to stop.
        LiveReload: Browser connected


I have also tried with the ports manually specified with the same results

[uumami@magi uumami.github.io]$  docker run --rm -it --network host -v /home/uumami/uumami/uumami.github.io/:/app uumami:page

I have tried with the docker compose up

# no version needed since 2020

services:
  jekyll:
    image: uumami:page
    volumes:
      - .:/site
    ports:
      - '4000:4000'
      - '35729:35729'


Where I get this warnings:

ARN[0000] The "UID" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GID" variable is not set. Defaulting to a blank string. 
WARN[0000] The "UID" variable is not set. Defaulting to a blank string.

Probably is not a bug, and I am missing something.

Originally created by @uumami on GitHub (Feb 8, 2024). So I have tried to get the livereload to develop the site live. My Dockerfile: ``` FROM ruby:3.1-slim-bullseye as jekyll RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ git \ && rm -rf /var/lib/apt/lists/* # used in the jekyll-server image, which is FROM this image COPY docker-entrypoint.sh /usr/local/bin/ RUN gem update --system && gem install jekyll && gem cleanup EXPOSE 4000 EXPOSE 35729 WORKDIR /site ENTRYPOINT [ "jekyll" ] CMD [ "--help" ] # build from the image we just built with different metadata FROM jekyll as jekyll-serve COPY . /site RUN bundle install --retry 5 --jobs 20 RUN bundle exec jekyll build # on every container start, check if Gemfile exists and warn if it's missing ENTRYPOINT [ "docker-entrypoint.sh" ] CMD [ "bundle", "exec", "jekyll", "serve","--livereload-min-delay", "10" ,"--open-url","--force_polling", "-H", "0.0.0.0", "-P", "4000" ] ``` Docker-command with output ``` [uumami@magi uumami.github.io]$ docker run --rm -it --network host -v /home/uumami/uumami/uumami.github.io/:/app uumami:page Bundle complete! 6 Gemfile dependencies, 46 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. 1 installed gem you directly depend on is looking for funding. Run `bundle fund` for details Configuration file: /site/_config.yml Theme Config file: /site/_config.yml Source: /site Destination: /site/_site Incremental build: disabled. Enable with --incremental Generating... done in 0.303 seconds. Auto-regeneration: enabled for '/site' LiveReload address: http://0.0.0.0:35729 Server address: http://0.0.0.0:4000/ Server running... press ctrl-c to stop. LiveReload: Browser connected ``` I have also tried with the ports manually specified with the same results ``` [uumami@magi uumami.github.io]$ docker run --rm -it --network host -v /home/uumami/uumami/uumami.github.io/:/app uumami:page ``` I have tried with the `docker compose up` ``` # no version needed since 2020 services: jekyll: image: uumami:page volumes: - .:/site ports: - '4000:4000' - '35729:35729' ``` Where I get this warnings: ``` ARN[0000] The "UID" variable is not set. Defaulting to a blank string. WARN[0000] The "GID" variable is not set. Defaulting to a blank string. WARN[0000] The "UID" variable is not set. Defaulting to a blank string. ``` Probably is not a bug, and I am missing something.
Author
Owner

@BretFisher commented on GitHub (Feb 9, 2024):

I don't know what those errors are. If you document each command step-by-step with a public example repo I can try to reproduce your issue on my machine.

@BretFisher commented on GitHub (Feb 9, 2024): I don't know what those errors are. If you document each command step-by-step with a public example repo I can try to reproduce your issue on my machine.
Author
Owner

@uumami commented on GitHub (Feb 9, 2024):

I don't know what those errors are. If you document each command step-by-step with a public example repo I can try to reproduce your issue on my machine.

Here is the repo

The commands are:

docker build -t uumami:page .
docker run --rm -it --network host -p 4000:4000 -p 35729:35729 -v /home/uumami/uumami/uumami.github.io/:/site uumami:page
@uumami commented on GitHub (Feb 9, 2024): > I don't know what those errors are. If you document each command step-by-step with a public example repo I can try to reproduce your issue on my machine. Here is the [repo](https://github.com/uumami/uumami.github.io) The commands are: ``` docker build -t uumami:page . ``` ``` docker run --rm -it --network host -p 4000:4000 -p 35729:35729 -v /home/uumami/uumami/uumami.github.io/:/site uumami:page ```
Author
Owner

@BretFisher commented on GitHub (Feb 13, 2024):

On macOS with Docker Desktop, your repo worked fine for me with docker compose up. I changed the _data/authors.yml file and it saw the change and regenerated the site.

@BretFisher commented on GitHub (Feb 13, 2024): On macOS with Docker Desktop, your repo worked fine for me with `docker compose up`. I changed the `_data/authors.yml` file and it saw the change and regenerated the site.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jekyll-serve#41