simpler instructions
authorRuben ten Hove <redacted>
Tue, 5 Jul 2022 17:38:20 +0000 (13:38 -0400)
committerRuben ten Hove <redacted>
Tue, 5 Jul 2022 17:38:20 +0000 (13:38 -0400)
Dockerfile
readme_template.md

index 11fa72ae6efeecd82b9089feea49a974ebdfd94b..72c7497350423bd1872bf8bc683c8ff284ce9a15 100644 (file)
@@ -4,8 +4,8 @@ ENV IN_CONTAINER 1
 
 RUN apk add --no-cache git sudo
 
-COPY . /usr/src/hosts
+COPY . /hosts
 
-RUN pip install --no-cache-dir --upgrade -r /usr/src/hosts/requirements.txt
+RUN pip install --no-cache-dir --upgrade -r /hosts/requirements.txt
 
-ENV PATH $PATH:/usr/src/hosts
+ENV PATH $PATH:/hosts
index e8bd431722746e55b6475dc0e046ca327fd8bc00..1dd10d2a7e5daf32a324aced210af578d30fbcdd 100644 (file)
@@ -84,27 +84,33 @@ docker build --no-cache . -t stevenblack-hosts
 Then run your command as such:
 
 ```sh
-docker run --rm -it -v "${PWD}/test:/pwd" stevenblack-hosts updateHostsFile.py
+docker run --rm -it ghcr.io/StevenBlack/hosts updateHostsFile.py
 ```
 
-> It is recommended to mount a host directory, so your changes are saved when you exit
-the container. Add `-v "${PWD}:/pwd" -w /pwd` after `-it` to mount your current working
-directory, and have that as current working directory in your container.
+> This will create the file, and remove it with the container when done, so not very
+> useful. Use the following example to automatically update your hosts file in place.
 
 #### Linux example
 
-This will replace your `/etc/hosts` and optionally add any custom hosts.
+This will replace your `/etc/hosts`.
 
-(Optionally) First create custom hosts files as per [the instructions](#how-do-i-control-which-sources-are-unified).
-
-Then run the following command in that same directory. Set extensions to your preference.
+Just run the following command. Set extensions to your preference.
 
 ```sh
-docker run --pull always --rm -it -v /etc/hosts:/etc/hosts -v "${PWD}:/pwd" \
--w /pwd ghcr.io/StevenBlack/hosts updateHostsFile.py --auto \
+docker run --pull always --rm -it -v /etc/hosts:/etc/hosts \
+ghcr.io/StevenBlack/hosts updateHostsFile.py --auto \
 --replace --extensions gambling porn
 ```
 
+If you want to add custom hosts or a whitelist, create either ot both files as per
+[the instructions](#how-do-i-control-which-sources-are-unified) and add the following
+arguments _before_ `ghcr.io/StevenBlack/hosts` depending on which you wish to use.
+
+```sh
+-v "path/to/myhosts:/hosts/myhosts" \
+-v "path/to/whitelist:/hosts/whitelist"
+```
+
 ### Option 2: Generate it in your own environment
 
 To generate your own amalgamated hosts files you will need Python 3.6 or later.
git clone https://git.99rst.org/PROJECT