Skip to content

Commit

Permalink
docker - healthcheck assumes /bin/sh
Browse files Browse the repository at this point in the history
Here is the command executed in the container context:

```
/bin/sh -c curl --silent --fail localhost:9001/health || exit 1
```

Since the move to UBI 8 image, sh is available under /usr/bin/sh.
This change ensures a link from /bin/sh to /usr/bin/sh.

Attempt to fix #1078
  • Loading branch information
morucci committed Nov 2, 2023
1 parent 8e7fb0c commit a85f188
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,14 @@ in rec {

# Ensure the home directory is r/w for any uid
rwHome = "mkdir -p -m 1777 ${home}";

# Ensure /bin/sh (docker healthcheck assumes /bin/sh)
binSh = "ln -s usr/bin/sh bin/sh";

in pkgs.dockerTools.buildLayeredImage {
name = "quay.io/change-metrics/monocle-exe";
contents = [ monocle-wrapper ];
extraCommands = "${createPasswd} && ${rwHome}";
extraCommands = "${createPasswd} && ${rwHome} && ${binSh}";
tag = "latest";
created = "now";
config = {
Expand Down

0 comments on commit a85f188

Please sign in to comment.