Skip to content

Commit 37390e5

Browse files
committed
Fix the Docker setup
I found that our previous Docker setup was not good enough and was failing on some machines. I propose the following changes, based on what has been done on the scala.epfl.ch website. The main “fix” is that we indicate a specific version of Ruby, rouge, and bundler. We also propose a different way to invoke docker-compose up that writes the generated files as a regular user (instead of root).
1 parent 0627969 commit 37390e5

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
FROM ruby:2.6
1+
FROM ruby:2.6.9
22

3-
RUN gem install bundler jekyll
3+
RUN gem install rouge -v3.30.0
4+
RUN gem install bundler:2.3.10 jekyll
45

56
WORKDIR /srv/jekyll
67

78
COPY Gemfile .
89
COPY Gemfile.lock .
910

11+
RUN echo -n "bundle version: " && bundle --version
12+
RUN chmod u+s /bin/chown
1013
RUN bundle install
11-

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ For more details, read on.
1919

2020
To build and view site with Docker:
2121

22-
docker-compose up
22+
env UID="$(id -u)" GID="$(id -g)" docker-compose up
2323

2424
It will incrementally build and serve site at `http://localhost:4000`.
2525

26+
In case the Dockerfile changed, re-build it with:
27+
28+
env UID="$(id -u)" GID="$(id -g)" docker-compose up --build
29+
2630
For more details on the Docker option, see [this issue](https://github.com/scala/docs.scala-lang/issues/1286).
2731

2832
## Contributing ##

docker-compose.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
version: "2"
1+
version: '2'
2+
23
services:
3-
scala-lang:
4+
jekyll:
5+
user: "${UID}:${GID}"
46
build: .
5-
command: bundle exec jekyll serve --incremental --host=0.0.0.0
7+
command: sh -c "chown $UID / && bundle exec jekyll serve --incremental --host=0.0.0.0 "
68
ports:
7-
- 4000:4000
9+
- '4000:4000'
810
volumes:
911
- .:/srv/jekyll

0 commit comments

Comments
 (0)