graphql-engine/v3/nix/docker.nix
Daniel Harvey eabc3966db Make sleep available in Docker images (#1026)
<!-- The PR description should answer 2 important questions: -->

### What

Add `coreutils` to Docker images.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

V3_GIT_ORIGIN_REV_ID: a614c47758b726729208428890586d5aabac0797
2024-08-28 12:14:08 +00:00

30 lines
723 B
Nix

# This is a function that returns a derivation for a docker image.
{ dockerTools
, lib
, package
, image-name
, pkgs
, architecture ? null
, tag ? null # defaults to the output hash
, extraConfig ? { } # see config options at: https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions
}:
let
args = {
name = image-name;
created = "now";
contents = [ pkgs.cacert pkgs.bash pkgs.coreutils package ];
config = {
Entrypoint = [
"/bin/${package.pname}"
];
} // extraConfig;
}
// lib.optionalAttrs (tag != null) {
inherit tag;
} // lib.optionalAttrs (architecture != null) {
inherit architecture;
};
in
dockerTools.buildLayeredImage args