gruntwork-io / health-checker

A simple HTTP server that will return 200 OK if all configured health checks pass.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v0.0.5 doesn't run inside docker container.

wesley-staples opened this issue · comments

When I attempt to run health-checker --version I get the following output:

./health-checker: line 1: --2021-04-02: command not found
./health-checker: line 2: syntax error near unexpected token `('
./health-checker: line 2: `Resolving github.com (github.com)... 140.82.113.4'

I have tried both an alpine and ubuntu container. The darwin binary runs fine on my mac so I assume it's something about docker. does anyone have any suggestions?

I'm attempting to run a datadog agent on fargate so I need a health check.

Sanity check: are you running the Linux version of the binaries in the container?

Yes I tried both the amd64 and 386 versions.

Can you share the full Dockerfile, command you're running, and log output? I'm really struggling to see where the --2021-04-2 and Resolving github.com business is coming from...

Dockerfile:

FROM ubuntu:latest

# install tools
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y curl wget

# install the webserver
RUN wget -o /opt/health-checker_linux_amd64 https://github.com/gruntwork-io/health-checker/releases/download/v0.0.5/health-checker_linux_amd64 && mv /opt/health-checker_linux_amd64 /opt/health-checker && chmod +x /opt/health-checker

# add entrypoint script
ADD docker-entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

EXPOSE 8000 8125 8126 8127
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["some_command"]

I then run docker exec -it <name> bash and /opt/health-checker --version

I think there's something wrong with how you're using wget. When I ran:

wget -o /opt/health-checker_linux_amd64 https://github.com/gruntwork-io/health-checker/releases/download/v0.0.5/health-checker_linux_amd64 && mv /opt/health-checker_linux_amd64 /opt/health-checker && chmod +x /opt/health-checker

The binary, health-checker_linux_amd64, got stored to the current working directory, and worked just fine. What got stored at /opt/health-checker was the log output:

$ cat /opt/health-checker_linux_amd64 
--2021-04-12 11:42:30--  https://github.com/gruntwork-io/health-checker/releases/download/v0.0.5/health-checker_linux_amd64
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-releases.githubusercontent.com/114062675/b759d400-5bb0-11e9-85b8-f25b59dc5df4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210412%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210412T114231Z&X-Amz-Expires=300&X-Amz-Signature=7293a856e3392300d6261c8d3e9fd53b9fc47e75e06611a58d5a66ee6a373823&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=114062675&response-content-disposition=attachment%3B%20filename%3Dhealth-checker_linux_amd64&response-content-type=application%2Foctet-stream [following]
--2021-04-12 11:42:31--  https://github-releases.githubusercontent.com/114062675/b759d400-5bb0-11e9-85b8-f25b59dc5df4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210412%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210412T114231Z&X-Amz-Expires=300&X-Amz-Signature=7293a856e3392300d6261c8d3e9fd53b9fc47e75e06611a58d5a66ee6a373823&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=114062675&response-content-disposition=attachment%3B%20filename%3Dhealth-checker_linux_amd64&response-content-type=application%2Foctet-stream
Resolving github-releases.githubusercontent.com (github-releases.githubusercontent.com)... 185.199.110.154, 185.199.111.154, 185.199.109.154, ...
Connecting to github-releases.githubusercontent.com (github-releases.githubusercontent.com)|185.199.110.154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8385211 (8.0M) [application/octet-stream]
Saving to: 'health-checker_linux_amd64'

     0K .......... .......... .......... .......... ..........  0% 5.32M 1s
    50K .......... .......... .......... .......... ..........  1% 8.64M 1s
   100K .......... .......... .......... .......... ..........  1% 3.15M 2s
   150K .......... .......... .......... .......... ..........  2% 8.84M 1s
   200K .......... .......... .......... .......... ..........  3% 16.2M 1s
   250K .......... .......... .......... .......... ..........  3% 11.9M 1s
   300K .......... .......... .......... .......... ..........  4% 10.6M 1s
   350K .......... .......... .......... .......... ..........  4% 14.4M 1s
   400K .......... .......... .......... .......... ..........  5% 12.4M 1s
   450K .......... .......... .......... .......... ..........  6% 15.8M 1s
   500K .......... .......... .......... .......... ..........  6% 13.0M 1s
   550K .......... .......... .......... .......... ..........  7% 23.6M 1s
   600K .......... .......... .......... .......... ..........  7% 18.1M 1s
   650K .......... .......... .......... .......... ..........  8% 11.5M 1s
   700K .......... .......... .......... .......... ..........  9% 22.2M 1s
   750K .......... .......... .......... .......... ..........  9% 16.2M 1s
   800K .......... .......... .......... .......... .......... 10% 15.3M 1s
   850K .......... .......... .......... .......... .......... 10% 19.7M 1s
   900K .......... .......... .......... .......... .......... 11% 23.4M 1s
   950K .......... .......... .......... .......... .......... 12% 13.0M 1s
  1000K .......... .......... .......... .......... .......... 12% 10.4M 1s
  1050K .......... .......... .......... .......... .......... 13% 27.0M 1s
  1100K .......... .......... .......... .......... .......... 14% 11.6M 1s
  1150K .......... .......... .......... .......... .......... 14% 13.6M 1s
  1200K .......... .......... .......... .......... .......... 15% 3.32M 1s
  1250K .......... .......... .......... .......... .......... 15% 42.6M 1s
  1300K .......... .......... .......... .......... .......... 16% 14.7M 1s
  1350K .......... .......... .......... .......... .......... 17% 9.39M 1s
  1400K .......... .......... .......... .......... .......... 17% 22.7M 1s
  1450K .......... .......... .......... .......... .......... 18% 17.4M 1s
  1500K .......... .......... .......... .......... .......... 18% 7.05M 1s
  1550K .......... .......... .......... .......... .......... 19% 41.3M 1s
  1600K .......... .......... .......... .......... .......... 20% 23.8M 1s
  1650K .......... .......... .......... .......... .......... 20% 8.69M 1s
  1700K .......... .......... .......... .......... .......... 21% 21.3M 1s
  1750K .......... .......... .......... .......... .......... 21% 16.7M 1s
  1800K .......... .......... .......... .......... .......... 22% 3.70M 1s
  1850K .......... .......... .......... .......... .......... 23% 27.0M 1s
  1900K .......... .......... .......... .......... .......... 23% 23.0M 1s
  1950K .......... .......... .......... .......... .......... 24% 23.7M 1s
  2000K .......... .......... .......... .......... .......... 25% 10.2M 1s
  2050K .......... .......... .......... .......... .......... 25% 23.7M 1s
  2100K .......... .......... .......... .......... .......... 26% 24.9M 1s
  2150K .......... .......... .......... .......... .......... 26% 15.6M 0s
  2200K .......... .......... .......... .......... .......... 27% 18.4M 0s
  2250K .......... .......... .......... .......... .......... 28% 16.1M 0s
  2300K .......... .......... .......... .......... .......... 28% 42.2M 0s
  2350K .......... .......... .......... .......... .......... 29% 24.3M 0s
  2400K .......... .......... .......... .......... .......... 29% 4.34M 0s
  2450K .......... .......... .......... .......... .......... 30% 10.2M 0s
  2500K .......... .......... .......... .......... .......... 31% 28.6M 0s
  2550K .......... .......... .......... .......... .......... 31% 8.90M 0s
  2600K .......... .......... .......... .......... .......... 32% 36.9M 0s
  2650K .......... .......... .......... .......... .......... 32% 16.8M 0s
  2700K .......... .......... .......... .......... .......... 33% 13.5M 0s
  2750K .......... .......... .......... .......... .......... 34% 16.4M 0s
  2800K .......... .......... .......... .......... .......... 34% 11.1M 0s
  2850K .......... .......... .......... .......... .......... 35% 19.5M 0s
  2900K .......... .......... .......... .......... .......... 36% 13.4M 0s
  2950K .......... .......... .......... .......... .......... 36% 17.3M 0s
  3000K .......... .......... .......... .......... .......... 37% 17.8M 0s
  3050K .......... .......... .......... .......... .......... 37% 16.8M 0s
  3100K .......... .......... .......... .......... .......... 38% 11.5M 0s
  3150K .......... .......... .......... .......... .......... 39% 28.6M 0s
  3200K .......... .......... .......... .......... .......... 39% 11.7M 0s
  3250K .......... .......... .......... .......... .......... 40% 12.1M 0s
  3300K .......... .......... .......... .......... .......... 40% 14.5M 0s
  3350K .......... .......... .......... .......... .......... 41% 20.1M 0s
  3400K .......... .......... .......... .......... .......... 42% 23.0M 0s
  3450K .......... .......... .......... .......... .......... 42% 15.3M 0s
  3500K .......... .......... .......... .......... .......... 43% 18.6M 0s
  3550K .......... .......... .......... .......... .......... 43% 14.2M 0s
  3600K .......... .......... .......... .......... .......... 44% 2.11M 0s
  3650K .......... .......... .......... .......... .......... 45% 17.9M 0s
  3700K .......... .......... .......... .......... .......... 45% 46.4M 0s
  3750K .......... .......... .......... .......... .......... 46% 27.6M 0s
  3800K .......... .......... .......... .......... .......... 47% 11.0M 0s
  3850K .......... .......... .......... .......... .......... 47% 4.21M 0s
  3900K .......... .......... .......... .......... .......... 48% 34.1M 0s
  3950K .......... .......... .......... .......... .......... 48% 43.8M 0s
  4000K .......... .......... .......... .......... .......... 49% 54.2M 0s
  4050K .......... .......... .......... .......... .......... 50% 46.1M 0s
  4100K .......... .......... .......... .......... .......... 50% 53.0M 0s
  4150K .......... .......... .......... .......... .......... 51% 5.28M 0s
  4200K .......... .......... .......... .......... .......... 51% 25.0M 0s
  4250K .......... .......... .......... .......... .......... 52% 26.5M 0s
  4300K .......... .......... .......... .......... .......... 53% 10.7M 0s
  4350K .......... .......... .......... .......... .......... 53% 16.5M 0s
  4400K .......... .......... .......... .......... .......... 54% 21.0M 0s
  4450K .......... .......... .......... .......... .......... 54% 11.6M 0s
  4500K .......... .......... .......... .......... .......... 55% 31.0M 0s
  4550K .......... .......... .......... .......... .......... 56% 13.2M 0s
  4600K .......... .......... .......... .......... .......... 56% 11.9M 0s
  4650K .......... .......... .......... .......... .......... 57% 31.0M 0s
  4700K .......... .......... .......... .......... .......... 58% 3.68M 0s
  4750K .......... .......... .......... .......... .......... 58% 2.83M 0s
  4800K .......... .......... .......... .......... .......... 59% 3.39M 0s
  4850K .......... .......... .......... .......... .......... 59% 3.03M 0s
  4900K .......... .......... .......... .......... .......... 60% 4.03M 0s
  4950K .......... .......... .......... .......... .......... 61% 7.23M 0s
  5000K .......... .......... .......... .......... .......... 61% 24.4M 0s
  5050K .......... .......... .......... .......... .......... 62% 52.6M 0s
  5100K .......... .......... .......... .......... .......... 62% 57.3M 0s
  5150K .......... .......... .......... .......... .......... 63% 29.0M 0s
  5200K .......... .......... .......... .......... .......... 64% 49.4M 0s
  5250K .......... .......... .......... .......... .......... 64% 48.8M 0s
  5300K .......... .......... .......... .......... .......... 65% 88.9M 0s
  5350K .......... .......... .......... .......... .......... 65% 17.1M 0s
  5400K .......... .......... .......... .......... .......... 66% 18.3M 0s
  5450K .......... .......... .......... .......... .......... 67% 24.6M 0s
  5500K .......... .......... .......... .......... .......... 67% 16.7M 0s
  5550K .......... .......... .......... .......... .......... 68% 21.7M 0s
  5600K .......... .......... .......... .......... .......... 68% 15.9M 0s
  5650K .......... .......... .......... .......... .......... 69% 16.0M 0s
  5700K .......... .......... .......... .......... .......... 70% 16.5M 0s
  5750K .......... .......... .......... .......... .......... 70% 27.4M 0s
  5800K .......... .......... .......... .......... .......... 71% 15.1M 0s
  5850K .......... .......... .......... .......... .......... 72% 10.2M 0s
  5900K .......... .......... .......... .......... .......... 72% 21.0M 0s
  5950K .......... .......... .......... .......... .......... 73% 18.7M 0s
  6000K .......... .......... .......... .......... .......... 73% 12.1M 0s
  6050K .......... .......... .......... .......... .......... 74% 15.6M 0s
  6100K .......... .......... .......... .......... .......... 75% 19.6M 0s
  6150K .......... .......... .......... .......... .......... 75% 38.3M 0s
  6200K .......... .......... .......... .......... .......... 76% 17.6M 0s
  6250K .......... .......... .......... .......... .......... 76% 11.2M 0s
  6300K .......... .......... .......... .......... .......... 77% 16.2M 0s
  6350K .......... .......... .......... .......... .......... 78% 22.5M 0s
  6400K .......... .......... .......... .......... .......... 78% 11.8M 0s
  6450K .......... .......... .......... .......... .......... 79% 13.7M 0s
  6500K .......... .......... .......... .......... .......... 79% 16.0M 0s
  6550K .......... .......... .......... .......... .......... 80% 24.6M 0s
  6600K .......... .......... .......... .......... .......... 81% 23.9M 0s
  6650K .......... .......... .......... .......... .......... 81% 11.5M 0s
  6700K .......... .......... .......... .......... .......... 82% 12.6M 0s
  6750K .......... .......... .......... .......... .......... 83% 37.9M 0s
  6800K .......... .......... .......... .......... .......... 83% 19.3M 0s
  6850K .......... .......... .......... .......... .......... 84% 12.0M 0s
  6900K .......... .......... .......... .......... .......... 84% 22.5M 0s
  6950K .......... .......... .......... .......... .......... 85% 17.6M 0s
  7000K .......... .......... .......... .......... .......... 86% 23.8M 0s
  7050K .......... .......... .......... .......... .......... 86% 16.4M 0s
  7100K .......... .......... .......... .......... .......... 87% 11.7M 0s
  7150K .......... .......... .......... .......... .......... 87% 23.3M 0s
  7200K .......... .......... .......... .......... .......... 88% 18.7M 0s
  7250K .......... .......... .......... .......... .......... 89% 14.4M 0s
  7300K .......... .......... .......... .......... .......... 89% 25.7M 0s
  7350K .......... .......... .......... .......... .......... 90% 24.5M 0s
  7400K .......... .......... .......... .......... .......... 90% 15.9M 0s
  7450K .......... .......... .......... .......... .......... 91% 16.1M 0s
  7500K .......... .......... .......... .......... .......... 92% 50.9M 0s
  7550K .......... .......... .......... .......... .......... 92% 12.2M 0s
  7600K .......... .......... .......... .......... .......... 93% 15.1M 0s
  7650K .......... .......... .......... .......... .......... 94% 17.9M 0s
  7700K .......... .......... .......... .......... .......... 94% 12.1M 0s
  7750K .......... .......... .......... .......... .......... 95% 26.6M 0s
  7800K .......... .......... .......... .......... .......... 95% 23.5M 0s
  7850K .......... .......... .......... .......... .......... 96% 23.6M 0s
  7900K .......... .......... .......... .......... .......... 97% 17.0M 0s
  7950K .......... .......... .......... .......... .......... 97% 14.2M 0s
  8000K .......... .......... .......... .......... .......... 98% 20.5M 0s
  8050K .......... .......... .......... .......... .......... 98% 20.4M 0s
  8100K .......... .......... .......... .......... .......... 99% 18.0M 0s
  8150K .......... .......... .......... ........             100% 30.9M=0.6s

2021-04-12 11:42:31 (13.1 MB/s) - 'health-checker_linux_amd64' saved [8385211/8385211]

So executing that is what's causing the error you're seeing with the date, Resolving github.com, etc.

Thank you for your time on this.