Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include wget command in image for healthcheck #331

Open
gjrtimmer opened this issue Mar 1, 2023 · 4 comments
Open

Include wget command in image for healthcheck #331

gjrtimmer opened this issue Mar 1, 2023 · 4 comments
Labels
secondary-feature A low priority feature

Comments

@gjrtimmer
Copy link

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
@mageddo
Copy link
Owner

mageddo commented 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.

@mageddo mageddo added the waiting-feedback Answered by repo owners and waiting reporter feedback label Mar 4, 2023
@gunar
Copy link

gunar commented 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?

@mageddo
Copy link
Owner

mageddo commented 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

@mageddo
Copy link
Owner

mageddo commented Mar 12, 2023

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

@mageddo mageddo added secondary-feature A low priority feature and removed waiting-feedback Answered by repo owners and waiting reporter feedback labels Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
secondary-feature A low priority feature
Projects
None yet
Development

No branches or pull requests

3 participants