Skip to content

Commit bdcd057

Browse files
authored
Improve development dockerfile and associated readme (#460)
1 parent 3e353de commit bdcd057

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# making updates to the accumulo website without requiring the dev
33
# to maintain a local ruby development environment.
44

5-
FROM ruby:3.2.2-slim-bullseye as base
5+
FROM ruby:3.2.2-slim-bullseye AS base
66

7-
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
RUN apt update && apt install -y --no-install-recommends \
88
build-essential \
99
git \
1010
curl \
@@ -17,13 +17,14 @@ WORKDIR /mnt/workdir
1717
# from the mounted directory. But that's not available during the
1818
# docker build, so we need to copy them in to pre-install the Gems
1919

20-
COPY Gemfile ./Gemfile
21-
COPY Gemfile.lock ./Gemfile.lock
20+
COPY Gemfile Gemfile.lock ./
2221

2322
# Gems will be installed under GEM_HOME which is set by the ruby image.
2423
# See https://hub.docker.com/_/ruby for details.
2524

26-
RUN gem update --system && bundle install && gem cleanup
25+
RUN gem update --system \
26+
&& bundle install \
27+
&& gem cleanup
2728

2829
ENV HOST=0.0.0.0
2930
ENV PORT=4000

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ Jekyll will print a local URL where the site can be viewed (usually,
109109

110110
### Testing using Docker environment
111111

112-
A containerized development environment can be built using the local
113-
Dockerfile.
114-
115-
116112
A containerized development environment can be built using the local
117113
Dockerfile. You can build it with the following command:
118114

@@ -123,7 +119,8 @@ docker build -t webdev .
123119
This action will produce a `webdev` image, with all the website's build
124120
prerequisites preinstalled. When a container is run from this image, it
125121
will perform a `jekyll serve` command with the polling option enabled,
126-
so that changes you make locally will be immediately reflected.
122+
so that changes you make locally will be immediately reflected after
123+
reloading the page in your browser.
127124

128125
When you run a container using the webdev image, your current working
129126
directory will be mounted, so that any changes made by the build inside
@@ -137,20 +134,22 @@ docker run -d -v "$PWD":/mnt/workdir -p 4000:4000 webdev
137134
While this container is running, you will be able to review the rendered website
138135
in your local browser at [http://127.0.0.1:4000/](http://127.0.0.1:4000/).
139136

140-
141137
Shell access can be obtained by overriding the default container command.
142138

143139
This is useful for adding new gems, or modifying the Gemfile.lock for updating
144140
existing dependencies.
145141

146-
When using shell access the local directory must be mounted to ensure
142+
When using shell access, the local directory must be mounted to ensure
147143
the Gemfile and Gemfile.lock updates are reflected in your local
148144
environment so you can create a commit and submit a PR.
149145

150146
```bash
151147
docker run -v "$PWD":/mnt/workdir -it webdev /bin/bash
152148
```
153149

150+
You may need to manually delete the `_site` or `.jekyll-cache` directories if
151+
they already exist and are causing issues with the build.
152+
154153
## Publishing
155154

156155
Changes pushed to our `main` branch will automatically trigger Jekyll to

0 commit comments

Comments
 (0)