[TOC]
- Ensure Docker is installed and running (https://docs.docker.com/desktop/)
-
Define the absolute parent path of repository bitcoinops.github.io .
repath=~/Desktop/
-
Create the parent folder and go into the parent folder.
mkdir -p ${repath} cd ${repath}
-
Download the repository bitcoinops.github.io .
git clone https://github.com/bitcoinops/bitcoinops.github.io
-
Building the site.
# Some of the dependencies can take a long time to install on some systems, so be patient. docker run -d --name bitcoinops -p 4000:4000 -v ${repath}/bitcoinops.github.io:/root/bitcoinops.github.io -w /root/bitcoinops.github.io ruby:2.6.4-stretch /bin/bash -c "bundle install && make preview"
-
Output the bitcoinops container log
docker logs -f bitcoinops
-
The bitcoinops container prints a log like this if building the site is successful.
Server address: http://0.0.0.0:4000/ Server running... press ctrl-c to stop.
-
Visit URL 127.0.0.1:4000 in your browser to view the site.
-
Edit files and save files, then refresh the site in a browser, the site will show the newest content.
# list all containers.
docker ps -a
# list all running containers.
docker ps
# start a container.
containername=bitcoinops
docker start ${containername}
# stop a container.
containername=bitcoinops
docker stop ${containername}
# output a container log.
containername=bitcoinops
docker logs -f ${containername}