[GH-ISSUE #331] Include wget command in image for healthcheck #118

Closed
opened 2026-02-26 04:34:06 +03:00 by kerem · 4 comments
Owner

Originally created by @gjrtimmer on GitHub (Mar 1, 2023).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/331

What is expected

wget command to be available so healthcheck can be used

What is Happening

wget command not included in image

Changes (Optional)

Please add wget command to image.

docker-compose.yml healthcheck

healthcheck:
    test: wget --no-verbose --tries=1 --no-check-certificate --spider http://localhost:5380
    interval: 10s
    timeout: 10s
    retries: 3
    start_period: 10s
Originally created by @gjrtimmer on GitHub (Mar 1, 2023). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/331 ### What is expected wget command to be available so healthcheck can be used ### What is Happening wget command not included in image ### Changes (Optional) Please add wget command to image. docker-compose.yml healthcheck ```yaml healthcheck: test: wget --no-verbose --tries=1 --no-check-certificate --spider http://localhost:5380 interval: 10s timeout: 10s retries: 3 start_period: 10s ```
kerem 2026-02-26 04:34:06 +03:00
Author
Owner

@mageddo commented on GitHub (Mar 2, 2023):

Hey, it's an DPS acceptance criteria to have a minimal docker image, so add wget to the image will increase its size, I think healthcheck is not a must have, but a nice to have feature unless it's causing some bug, I'm not inclined to add such feature because it will against DPS acceptance criteria.

You are able to create an extended image and configure the healthcheck if you really need it for your use case though.

<!-- gh-comment-id:1452127799 --> @mageddo commented on GitHub (Mar 2, 2023): Hey, it's an DPS acceptance criteria to have a minimal docker image, so add wget to the image will increase its size, I think healthcheck is not a must have, but a nice to have feature unless it's causing some bug, I'm not inclined to add such feature because it will against DPS acceptance criteria. You are able to create an extended image and configure the healthcheck if you really need it for your use case though.
Author
Owner

@gunar commented on GitHub (Mar 7, 2023):

@gjrtimmer I've been having some success with this:

test: bash -c "exec 5<>/dev/tcp/dps.docker/53"

@mageddo is there any other way you might recommend doing a healthcheck?

<!-- gh-comment-id:1458468608 --> @gunar commented on GitHub (Mar 7, 2023): @gjrtimmer I've been having some success with this: ``` test: bash -c "exec 5<>/dev/tcp/dps.docker/53" ``` @mageddo is there any other way you might recommend doing a healthcheck?
Author
Owner

@mageddo commented on GitHub (Mar 12, 2023):

@gunar yeah, it must do the job as you are using dps.docker hostname it means that if you are solving that name then DPS is working and 53 port is listening.

On the future I may consider implement some more complete health and embed it at the container without have to install new commands to the container using some native Linux communication between sh and the process maybe signals, named pipes or even tcp .

Just a draft I've made some tests using your command:

bash -c "exec 5<>/dev/tcp/127.0.0.1/8053 && echo -e -n '\x0\x1d\x26\x1a\x1\x0\x0\x1\x0\x0\x0\x0\x0\x0\x4\x68\x6f\x73\x74\x6\x64\x6f\x63\x6b\x65\x72\x0\x0\x1\x0\x1' >&5 && head -c2 <&5 | od -t x1 && exec 5<&-"
0000000 00 2d
0000002

<!-- gh-comment-id:1465243912 --> @mageddo commented on GitHub (Mar 12, 2023): @gunar yeah, it must do the job as you are using `dps.docker` hostname it means that if you are solving that name then DPS is working and 53 port is listening. On the future I may consider implement some more complete health and embed it at the container without have to install new commands to the container using some native Linux communication between sh and the process maybe signals, named pipes or even tcp . Just a draft I've made some tests using your command: * Created a DNS tcp query * Encoded it to hexadecimal * Sent the message to DPS tcp server * Get the first 2 bytes response and encoded that to hex (query response size) * The print to the output https://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip ```bash bash -c "exec 5<>/dev/tcp/127.0.0.1/8053 && echo -e -n '\x0\x1d\x26\x1a\x1\x0\x0\x1\x0\x0\x0\x0\x0\x0\x4\x68\x6f\x73\x74\x6\x64\x6f\x63\x6b\x65\x72\x0\x0\x1\x0\x1' >&5 && head -c2 <&5 | od -t x1 && exec 5<&-" 0000000 00 2d 0000002 ```
Author
Owner

@mageddo commented on GitHub (Mar 12, 2023):

In the meanwhile I think we should consider to add a command like yours at the healthcheck

<!-- gh-comment-id:1465244141 --> @mageddo commented on GitHub (Mar 12, 2023): In the meanwhile I think we should consider to add a command like yours at the healthcheck
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dns-proxy-server-mageddo#118
No description provided.