This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo-website.git
The following commit(s) were added to refs/heads/main by this push: new bdcd057e3 Improve development dockerfile and associated readme (#460) bdcd057e3 is described below commit bdcd057e3c40c1f0ff788e42823b4def69844466 Author: Dom G. <domgargu...@apache.org> AuthorDate: Thu May 8 16:13:39 2025 -0400 Improve development dockerfile and associated readme (#460) --- Dockerfile | 11 ++++++----- README.md | 13 ++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2798588ac..86c4b3a56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,9 @@ # making updates to the accumulo website without requiring the dev # to maintain a local ruby development environment. -FROM ruby:3.2.2-slim-bullseye as base +FROM ruby:3.2.2-slim-bullseye AS base -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apt update && apt install -y --no-install-recommends \ build-essential \ git \ curl \ @@ -17,13 +17,14 @@ WORKDIR /mnt/workdir # from the mounted directory. But that's not available during the # docker build, so we need to copy them in to pre-install the Gems -COPY Gemfile ./Gemfile -COPY Gemfile.lock ./Gemfile.lock +COPY Gemfile Gemfile.lock ./ # Gems will be installed under GEM_HOME which is set by the ruby image. # See https://hub.docker.com/_/ruby for details. -RUN gem update --system && bundle install && gem cleanup +RUN gem update --system \ + && bundle install \ + && gem cleanup ENV HOST=0.0.0.0 ENV PORT=4000 diff --git a/README.md b/README.md index 13c68bbd4..a61c5adf2 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,6 @@ Jekyll will print a local URL where the site can be viewed (usually, ### Testing using Docker environment -A containerized development environment can be built using the local -Dockerfile. - - A containerized development environment can be built using the local Dockerfile. You can build it with the following command: @@ -123,7 +119,8 @@ docker build -t webdev . This action will produce a `webdev` image, with all the website's build prerequisites preinstalled. When a container is run from this image, it will perform a `jekyll serve` command with the polling option enabled, -so that changes you make locally will be immediately reflected. +so that changes you make locally will be immediately reflected after +reloading the page in your browser. When you run a container using the webdev image, your current working directory will be mounted, so that any changes made by the build inside @@ -137,13 +134,12 @@ docker run -d -v "$PWD":/mnt/workdir -p 4000:4000 webdev While this container is running, you will be able to review the rendered website in your local browser at [http://127.0.0.1:4000/](http://127.0.0.1:4000/). - Shell access can be obtained by overriding the default container command. This is useful for adding new gems, or modifying the Gemfile.lock for updating existing dependencies. -When using shell access the local directory must be mounted to ensure +When using shell access, the local directory must be mounted to ensure the Gemfile and Gemfile.lock updates are reflected in your local environment so you can create a commit and submit a PR. @@ -151,6 +147,9 @@ environment so you can create a commit and submit a PR. docker run -v "$PWD":/mnt/workdir -it webdev /bin/bash ``` +You may need to manually delete the `_site` or `.jekyll-cache` directories if +they already exist and are causing issues with the build. + ## Publishing Changes pushed to our `main` branch will automatically trigger Jekyll to