Skip to content

Commit

Permalink
Trailing slashes on volumes fail on newer versions of docker-compose (#…
Browse files Browse the repository at this point in the history
…949)

* Trailing slashes on volumes fail on newer versions of docker-compose

See [Issue 947](#947)
for the background.

This PR proposes removing trailing slashes from all documentation,
examples and scripts.

Signed-off-by: Phill Kelley <[email protected]>
  • Loading branch information
Paraphraser authored Dec 11, 2021
1 parent 523762e commit b0a5a0f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services:
# WEBPASSWORD: 'set a secure password here or it will be random'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# Recommended but not required (DHCP needs NET_ADMIN)
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
Expand Down Expand Up @@ -71,8 +71,8 @@ This container uses 2 popular ports, port 53 and port 80, so **may conflict with
If you're using a Red Hat based distribution with an SELinux Enforcing policy add `:z` to line with volumes like so:

```
-v "$(pwd)/etc-pihole/:/etc/pihole/:z" \
-v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/:z" \
-v "$(pwd)/etc-pihole:/etc/pihole:z" \
-v "$(pwd)/etc-dnsmasq.d:/etc/dnsmasq.d:z" \
```

Volumes are recommended for persisting data across container re-creations for updating images. The IP lookup variables may not work for everyone, please review their values and hard code IP and IPv6 if necessary.
Expand Down
6 changes: 3 additions & 3 deletions docker-compose-nginx-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ services:
- "67:67/udp"
- '8053:80/tcp'
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# run `touch ./var-log/pihole.log` first unless you like errors
# - './var-log/pihole.log:/var/log/pihole.log'
# Recommended but not required (DHCP needs NET_ADMIN)
Expand Down Expand Up @@ -51,7 +51,7 @@ services:
# ports:
# - '2368:2368/tcp'
# volumes:
# - '/etc/ghost/:/ghost-override'
# - '/etc/ghost:/ghost-override'
# environment:
# PROXY_LOCATION: ghost
# VIRTUAL_HOST: ghost.yourDomain.lan
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ services:
# WEBPASSWORD: 'set a secure password here or it will be random'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# run `touch ./var-log/pihole.log` first unless you like errors
# - './var-log/pihole.log:/var/log/pihole.log'
# Recommended but not required (DHCP needs NET_ADMIN)
Expand Down
4 changes: 2 additions & 2 deletions docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ docker run -d \
-p 53:53/tcp -p 53:53/udp \
-p 80:80 \
-e TZ="America/Chicago" \
-v "${PIHOLE_BASE}/etc-pihole/:/etc/pihole/" \
-v "${PIHOLE_BASE}/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
-v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
-v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
--dns=127.0.0.1 --dns=1.1.1.1 \
--restart=unless-stopped \
--hostname pi.hole \
Expand Down
8 changes: 4 additions & 4 deletions test/test_volume_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ echo "Testing $IMAGE with volumes base path $VOLUMES"
# Running stock+empty volumes (no ports to avoid conflicts)
CONTAINER="$(
docker run -d \
-v "$VOL_PH:/etc/pihole/" \
-v "$VOL_DM:/etc/dnsmasq.d/" \
-v "$VOL_PH:/etc/pihole" \
-v "$VOL_DM:/etc/dnsmasq.d" \
-v "/dev/null:/etc/pihole/adlists.list" \
--entrypoint='' \
$IMAGE \
Expand Down Expand Up @@ -92,8 +92,8 @@ assert_new_settings
docker rm -f $CONTAINER
CONTAINER="$(
docker run -d \
-v "$VOL_PH:/etc/pihole/" \
-v "$VOL_DM:/etc/dnsmasq.d/" \
-v "$VOL_PH:/etc/pihole" \
-v "$VOL_DM:/etc/dnsmasq.d" \
-v "/dev/null:/etc/pihole/adlists.list" \
--entrypoint='' \
$IMAGE \
Expand Down

0 comments on commit b0a5a0f

Please sign in to comment.