From d971cf1295c3a000e7525afe5c3c98cd6875a261 Mon Sep 17 00:00:00 2001 From: JJGadgets <5709019+JJGadgets@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:10:28 +0800 Subject: [PATCH 1/2] Improve Docker docs - Fix URLs referring to files in this repository - Better explain that we are creating the headscale directory and running the commands on the host Docker node - Place instructions to download example config file to use as config file, as recommended steps. --- docs/running-headscale-container.md | 31 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/running-headscale-container.md b/docs/running-headscale-container.md index 9c658bf7..fc6fb38b 100644 --- a/docs/running-headscale-container.md +++ b/docs/running-headscale-container.md @@ -7,31 +7,44 @@ it is up to date, or working. This documentation has the goal of showing a user how-to set up and run `headscale` in a container. [Docker](https://www.docker.com) is used as the reference container implementation, but there is no reason that it should -not work with alternatives like [Podman](https://podman.io). +not work with alternatives like [Podman](https://podman.io). The Docker image can be found on Docker Hub [here](https://hub.docker.com/r/headscale/headscale). ## Configure and run `headscale` -1. Prepare a direction to hold `headscale` configuration and the [SQLite](https://www.sqlite.org/) database: +1. Prepare a directory on the host Docker node in your directory of choice, used to hold `headscale` configuration and the [SQLite](https://www.sqlite.org/) database: ```shell -mkdir config +mkdir ./headscale && cd ./headscale +mkdir ./config ``` -2. Create an empty SQlite datebase: +2. Create an empty SQlite datebase in the headscale directory: ```shell -touch config/db.sqlite +touch ./config/db.sqlite ``` -3. Create a `headscale` configuration: +3. **(Strongly Recommended)** Download a copy of the [example configuration](../config-example.yaml) from the [headscale repository](https://github.com/juanfont/headscale/). + +Using wget: +```shell +wget -O ./config/config.yaml https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml +``` + +Using curl: +```shell +curl https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml -o ./config/config.yaml +``` + +**(Advanced)** If you would like to hand craft a config file **instead** of downloading the example config file, create a blank `headscale` configuration in the headscale directory to edit: ```shell -touch config/config.yaml +touch ./config/config.yaml ``` -It is **strongly recommended** to copy the [example configuration](../config.yaml) from the [headscale repository](../) +Modify the config file to your preferences before launching Docker container. -4. Start the headscale server: +4. Start the headscale server while working in the host headscale directory: ```shell docker run \ From 897fa558b07a5a12249e3f3eb02d8b01adff5b7d Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Thu, 6 Jan 2022 17:25:07 +0800 Subject: [PATCH 2/2] prettier: Docker docs --- docs/running-headscale-container.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/running-headscale-container.md b/docs/running-headscale-container.md index fc6fb38b..d39f4d49 100644 --- a/docs/running-headscale-container.md +++ b/docs/running-headscale-container.md @@ -27,11 +27,13 @@ touch ./config/db.sqlite 3. **(Strongly Recommended)** Download a copy of the [example configuration](../config-example.yaml) from the [headscale repository](https://github.com/juanfont/headscale/). Using wget: + ```shell wget -O ./config/config.yaml https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml ``` Using curl: + ```shell curl https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml -o ./config/config.yaml ```