Skip to content

Commit 97cddca

Browse files
committed
Update docker entrypoint.
1 parent 846f4f0 commit 97cddca

File tree

4 files changed

+48
-6
lines changed

4 files changed

+48
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
-
1111

1212
### Changed
13-
-
13+
- Execute `bundle install` in entrypoint
14+
- Run jekyll with `bundle exec`
15+
- Interpret the CMD provided in context of `bundle exec`
16+
- All bundler features can be disabled by setting `NO_BUNDLER` to a non-empty value
1417

1518
### Fixed
1619
-

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ RUN apt-get update && apt-get -y install build-essential && rm -rf /var/lib/apt/
2222

2323
WORKDIR /data
2424

25-
CMD /docker-resources/entrypoint.sh
25+
ENTRYPOINT ["/docker-resources/entrypoint.sh"]

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ The API Documentation is available at [RubyDoc.info](http://www.rubydoc.info/gem
2424

2525
# Installation
2626

27+
**Docker** There is a docker image check out the section [Docker Usage](#docker-usage).
28+
2729
As a prerequisite for *Jekyll RDF* you of course need to install [*Jekyll*](https://jekyllrb.com/).
2830
Please take a look at the installations instructions at https://jekyllrb.com/docs/installation/.
2931

@@ -675,6 +677,38 @@ http://www.ifi.uio.no/INF3580/simpsons#Maggie
675677
|instance_template_mappings|Target URI as String : filename of the template as String|no default|Maps given URIs to template-files for rendering an individual instance|```instance_template_mappings: "http://www.ifi.uio.no/INF3580/simpsons#Abraham": "abraham.html"```|
676678
|class_template_mappings|Target URI as String : filename of the template as String|no default|Maps given URIs to template-files for rendering all instances of that class|```class_template_mappings: "http://xmlns.com/foaf/0.1/Person": "person.html"```|
677679

680+
# Docker Usage
681+
682+
There is also a [docker/podman image](https://github.com/AKSW/jekyll-rdf/pkgs/container/jekyll-rdf) that has jekyll and jekyll-rdf pre-installed.
683+
You can get it with:
684+
685+
```
686+
docker pull ghcr.io/aksw/jekyll-rdf:latest
687+
```
688+
689+
and run it e.g. with
690+
691+
```
692+
docker run --rm --workdir /page -v $PWD:/page ghcr.io/aksw/jekyll-rdf:latest
693+
```
694+
695+
or customize the jekyll execution with
696+
697+
```
698+
docker run --rm --workdir /page -v $PWD/sources:/page -v $PWD/build/jekyll:/build ghcr.io/aksw/jekyll-rdf:latest jekyll build -d /build
699+
```
700+
701+
The entrypoint of the image executes `bundle install` first an then runs `bundle exec jekyll build` or `bundle exec <your command>`.
702+
To keep the installed packages between runs specify the environment variable `BUNDLE_PATH` to a location that persists between runs, e.g. `-e BUNDLE_PATH=.vendor`.
703+
To disable the whole bundler stuff set `NO_BUNDLER` to a non-empty value, the entrypoint will run your command as it is.
704+
705+
## Docker Variables
706+
707+
| Name | Default | Description |
708+
|-|-|-|
709+
| `BUNDLE_PATH` | *unset* | Set the path where bundler installs the packages. See also the [bundler docs](https://bundler.io/v2.4/man/bundle-config.1.html#LIST-OF-AVAILABLE-KEYS). |
710+
| `NO_BUNDLER` | *unset* | Set to a non-empty value to disable all bundler parts in the entrypoint |
711+
678712
# Development
679713

680714
## Installation from source

docker-resources/entrypoint.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/bin/sh
22

3-
bundle install
4-
if [ $# -eq 0 ]
3+
if [ -z "$NO_BUNDLER" ]
4+
then
5+
bundle install
6+
if [ $# -eq 0 ]
57
then
6-
jekyll build
8+
bundle exec jekyll build
79
else
8-
$@
10+
bundle exec $@
11+
fi
12+
else
13+
$@
914
fi

0 commit comments

Comments
 (0)