File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ docker run \
2121 --mount type=bind,source=" $PWD " ,target=" /spark-website" \
2222 -w /spark-website \
2323 docs-builder:latest \
24- /bin/bash -c " sh .dev/run-in-container.sh"
24+ /bin/bash -c " .dev/run-in-container.sh"
Original file line number Diff line number Diff line change 1616#
1717
1818# 1.Set env variable.
19- export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-arm64
20- export PATH=$JAVA_HOME /bin:$PATH
19+ export JAVA_HOME=" /usr/lib/jvm/$( ls /usr/lib/jvm/ | grep java-17-openjdk | awk ' {print $NF} ' ) "
20+ export PATH=" $JAVA_HOME /bin:$PATH "
2121
2222# 2.Install bundler.
2323gem install bundler -v 2.4.22
2424bundle install
2525
26- # 3. Create a user matching the host UID/GID
27- groupadd -g $HOST_GID docuser
28- useradd -u $HOST_UID -g $HOST_GID -m docuser
26+ # 3. Create a user matching the host UID/GID, if it doesn't exist
27+ groupadd -g $HOST_GID docuser || true
28+ useradd -u $HOST_UID -g $HOST_GID -m docuser || true
29+ DOC_USER=$( getent passwd " $HOST_UID " | cut -d: -f1)
2930
3031# We need this link to make sure `python3` points to `python3.11` which contains the prerequisite packages.
3132ln -s " $( which python3.11) " " /usr/local/bin/python3"
3233
3334# Build docs
3435rm -rf .jekyll-cache
35- su docuser -c " bundle exec jekyll build"
36+ su " $DOC_USER " -c " bundle exec jekyll build"
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ docker build \
1818Once the image is built, navigate to the ` spark-website ` root directory, run the script which processes
1919the Markdown files in the Docker container.
2020```
21- SPARK_WEBSITE_PATH="/path/to/spark-website" sh .dev/build-docs.sh
21+ .dev/build-docs.sh
2222```
2323
2424## Docs sub-dir
You can’t perform that action at this time.
0 commit comments