Skip to content

Conversation

darosior
Copy link
Member

It was useful to me, so i cleaned it up and PR'd it in case others do not have a full Ruby toolchain installed, but do have Docker.

@darosior
Copy link
Member Author

(This is based on the CI config)

Copy link

@janb84 janb84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9f7a431

PR adds dockerfile (based on ci) and edited readme in contrib with instruction so that the bitcoincore.org website can be run locally for easy testing of changes.

This is a valuable addition and makes testing the changes locally easier without installing all the dependencies on the base machine.

  • code reviewed ✅
  • followed instructions to run it locally ✅

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9f7a431

Dockerfile is nice and tidy, and works well in testing.

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, but I think incrementally building the site at runtime makes more sense than doing it at build time (see suggestion).

Comment on lines +9 to +15
curl \
jekyll \
make \
ruby \
ruby-html-proofer \
ruby-jekyll-redirect-from \
ruby-kramdown-parser-gfm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make seems to be the only dependency we actually need here? All the others are duplicates: ruby is already provided by the base image, and the others are installed by bundle/specified by Gemfile.

RUN gem install bundler \
&& bundle install

RUN make build
Copy link
Contributor

@stickies-v stickies-v Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think building the website inside the image is ideal. It makes more sense to me to generate the website at runtime, in incremental mode. Keeps the image small, and the container more functional?

# Default Jekyll port
EXPOSE 4000

CMD ["bundle", "exec", "jekyll", "server", "--host", "0.0.0.0", "--future"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're duplicating Makefile commands anyway, I think it might make sense to avoid the make dependency entirely?

Suggested diff that combines all my suggestions:

git diff on 9f7a431
diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile
index f4e3897..9ed076a 100644
--- a/contrib/devtools/Dockerfile
+++ b/contrib/devtools/Dockerfile
@@ -4,26 +4,14 @@ ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true
 ENV JEKYLL_ENV=production
 ENV RUBYOPT="-KU -E utf-8:utf-8"
 
-RUN apt update \
-    && apt install -y \
-    curl \
-    jekyll \
-    make \
-    ruby \
-    ruby-html-proofer \
-    ruby-jekyll-redirect-from \
-    ruby-kramdown-parser-gfm
-
 WORKDIR /site
 
-COPY . .
+COPY Gemfile* ./
 
 RUN gem install bundler \
     && bundle install
 
-RUN make build
-
 # Default Jekyll port
 EXPOSE 4000
 
-CMD ["bundle", "exec", "jekyll", "server", "--host", "0.0.0.0", "--future"]
+CMD ["bundle", "exec", "jekyll", "serve", "--future", "--drafts", "--unpublished", "--incremental", "--strict_front_matter", "--host", "0.0.0.0"]

Or if we want to keep using make (e.g. also allowing the user to run docker run -it --rm -v "$PWD":/site -p 4000:4000 corewebsite make test, might be useful to add to the readme):

git diff on 9f7a431
diff --git a/Makefile b/Makefile
index 75b80c2..7e8c096 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ all: build test
 
 preview:
 	bundle exec jekyll clean
-	bundle exec jekyll serve --future --drafts --unpublished --incremental --strict_front_matter
+	bundle exec jekyll serve --future --drafts --unpublished --incremental --strict_front_matter --host 0.0.0.0
 
 build:
 	bundle exec jekyll clean
diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile
index f4e3897..eb38463 100644
--- a/contrib/devtools/Dockerfile
+++ b/contrib/devtools/Dockerfile
@@ -4,26 +4,19 @@ ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=true
 ENV JEKYLL_ENV=production
 ENV RUBYOPT="-KU -E utf-8:utf-8"
 
-RUN apt update \
-    && apt install -y \
-    curl \
-    jekyll \
+RUN apt-get update \
+    && apt-get install -y \
     make \
-    ruby \
-    ruby-html-proofer \
-    ruby-jekyll-redirect-from \
-    ruby-kramdown-parser-gfm
+    && rm -rf /var/lib/apt/lists/*
 
 WORKDIR /site
 
-COPY . .
+COPY Gemfile* ./
 
 RUN gem install bundler \
     && bundle install
 
-RUN make build
-
 # Default Jekyll port
 EXPOSE 4000
 
-CMD ["bundle", "exec", "jekyll", "server", "--host", "0.0.0.0", "--future"]
+CMD ["make", "preview"]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants