sixeyed / diamol

Code samples for the book "Learn Docker in a Month of Lunches"
https://www.manning.com/books/learn-docker-in-a-month-of-lunches
Creative Commons Attribution Share Alike 4.0 International
507 stars 273 forks source link

Chapter 14 lab - healthcheck #16

Closed oleg-glushko closed 3 years ago

oleg-glushko commented 4 years ago

Both ch04-image-of-the-day and ch09-image-of-the-day images don't include a curl application, so you can't write a healthcheck test using it. Both images don't include a curl application, so you can't write a healthcheck test using it. One either has to update these images or use a stub check like the "true" bash command to proceed.

image

xtbe commented 3 years ago

Fixing the image would probably my preferred approach but I took the opportunity to learn overriding the ENTRYPOINT in the docker-compose file and install curl, not recommended but it works

...
 iotd:
    image: diamol/ch04-image-of-the-day
    entrypoint: ["sh", "-c", "apt-get update ; apt-get install -y curl; java -jar /app/iotd-service-0.1.0.jar"]
...
sixeyed commented 3 years ago

Thanks for sending the issue Tom - nice hack too :) I've updated the Dockerfiles and pushed new versions of the ch04 images, so this should be fixed now.