Skip to content

Commit 458502e

Browse files
author
Chad Dougherty
committed
update docker instructions and add some notes about using podman
also clean up some extraneous trailing whitespace Signed-off-by: Chad Dougherty <[email protected]>
1 parent 87504ae commit 458502e

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

docs/local_previews.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Working with the repo locally
22

3-
Content-only changes can often be done directly on the GitHub website. Changes affecting the function or structure of the site should be previewed fully locally before being submitted via PR.
3+
Content-only changes can often be done directly on the GitHub website. Changes affecting the function or structure of the site should be previewed fully locally before being submitted via PR.
44

55
## Jekyll
66

7-
To preview the site locally, clone it.
7+
To preview the site locally, clone it.
88

99
Then you'll need to [install jekyll](https://jekyllrb.com/docs/installation/).
1010

@@ -14,9 +14,9 @@ Then go to the root of the site and issue (just once):
1414
$ bundle install
1515
```
1616

17-
which will install the necessary Ruby gems (the info for this is included in the repo files).
17+
which will install the necessary Ruby gems (the info for this is included in the repo files).
1818

19-
And then (also in the top level directory of your forked repository) to be able to see the rendered website, run
19+
And then (also in the top level directory of your forked repository) to be able to see the rendered website, run
2020

2121
```bash
2222
$ jekyll serve
@@ -32,6 +32,8 @@ If you are having trouble try `rm -rf _site`, followed by `bundle update`, then
3232

3333
You can build and run a Docker container to preview the site locally and support a local development workflow. If you do not already have Docker installed, please visit https://docs.docker.com/get-docker/ and follow the links to get started with Docker on your operating system.
3434

35+
These instructions also work with the [Podman](https://podman.io/) container management tool simply by substituting `podman` for `docker` in the commands below. This can either be done manually, by creating a shell alias (e.g., `alias podman=docker`), or by installing a package such as `podman-docker` to automatically handle this translation.
36+
3537
Build the container image:
3638

3739
```bash
@@ -59,9 +61,21 @@ To develop the website, launch the container using the following command, where
5961

6062
```bash
6163
docker run --rm -it -p 4000:4000 \
62-
-v $(pwd):/srv/jekyll \
64+
-u $(id -u):$(id -g) \
65+
-v $(pwd):/srv/jekyll:Z \
6366
us-rse-website:latest
6467
```
6568

69+
or, if using Podman in a rootless environment:
70+
71+
```bash
72+
podman run --rm -it -p 4000:4000 \
73+
--userns=keep-id \
74+
-v $(pwd):/srv/jekyll:Z \
75+
us-rse-website:latest
76+
```
77+
78+
If these commands fail, you may need to address any discrepancies between the user/group mapping in your container runtime and the permissions on the directory where the volume mount resides.
79+
6680
Edit a source file and save the changes. You will see Jekyll automatically regenerate the site, after which you can reload the page in your browser to see the rendered changes.
6781

0 commit comments

Comments
 (0)