Skip to content

Commit

Permalink
docker: Fix handling of PCAP variable (fixes syncthing#8567) (syncthi…
Browse files Browse the repository at this point in the history
…ng#8568)

This correctly handles the absense of the PCAP environment variable,
which was broken in the previous change.
  • Loading branch information
calmh committed Oct 2, 2022
1 parent 1e652de commit a206366
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apk add --no-cache ca-certificates su-exec tzdata libcap
COPY --from=builder /src/syncthing /bin/syncthing
COPY --from=builder /src/script/docker-entrypoint.sh /bin/entrypoint.sh

ENV PUID=1000 PGID=1000 HOME=/var/syncthing PCAP=
ENV PUID=1000 PGID=1000 HOME=/var/syncthing

HEALTHCHECK --interval=1m --timeout=10s \
CMD nc -z 127.0.0.1 8384 || exit 1
Expand Down
2 changes: 1 addition & 1 deletion script/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eu

if [ "$(id -u)" = '0' ]; then
binary="$1"
if [ "$PCAP" == "" ] ; then
if [ "${PCAP:-}" == "" ] ; then
# If Syncthing should have no extra capabilities, make sure to remove them
# from the binary. This will fail with an error if there are no
# capabilities to remove, hence the || true etc.
Expand Down

0 comments on commit a206366

Please sign in to comment.