Skip to content
30 changes: 23 additions & 7 deletions template/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
tonic-reflection = attrs: {
buildInputs = [ pkgs.rustfmt ];
};
stackable-secret-operator = attrs: {
buildInputs = [ pkgs.protobuf pkgs.rustfmt ];
};
krb5-sys = attrs: {
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ (pkgs.enableDebugging pkgs.krb5) ];
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/${pkgs.lib.getVersion pkgs.clang.cc}/include";
};
};
}
, meta ? pkgs.lib.importJSON ./nix/meta.json
Expand All @@ -27,14 +36,21 @@ rec {
dockerImage = pkgs.dockerTools.streamLayeredImage {
name = dockerName;
tag = dockerTag;
contents = [ pkgs.bashInteractive pkgs.coreutils pkgs.util-linuxMinimal ];
contents = [
# Common debugging tools
pkgs.bashInteractive pkgs.coreutils pkgs.util-linuxMinimal
# Kerberos 5 must be installed globally to load plugins correctly
pkgs.krb5
# Make the whole cargo workspace available on $PATH
build
];
config = {
Env =
let
fileRefVars = {
PRODUCT_CONFIG = deploy/config-spec/properties.yaml;
};
in pkgs.lib.concatLists (pkgs.lib.mapAttrsToList (env: path: pkgs.lib.optional (pkgs.lib.pathExists path) "${env}=${path}") fileRefVars);
Env =
let
fileRefVars = {
PRODUCT_CONFIG = deploy/config-spec/properties.yaml;
};
in pkgs.lib.concatLists (pkgs.lib.mapAttrsToList (env: path: pkgs.lib.optional (pkgs.lib.pathExists path) "${env}=${path}") fileRefVars);
Entrypoint = [ entrypoint ];
Cmd = [ "run" ];
};
Expand Down
7 changes: 5 additions & 2 deletions template/docker/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ RUN microdnf install -y yum \
&& yum clean all \
&& microdnf clean all

# Install kerberos client libraries
RUN microdnf install -y krb5-libs libkadm5 && microdnf clean all

COPY LICENSE /licenses/LICENSE

COPY --from=builder /app/stackable-{[ operator.name }] /
COPY --from=builder /app/* /usr/local/bin
{[% if operator.include_productconfig is undefined or operator.include_productconfig == true %}]
COPY deploy/config-spec/properties.yaml /etc/stackable/{[ operator.name }]/config-spec/properties.yaml
{[% endif %}]
Expand All @@ -34,5 +37,5 @@ RUN groupadd -g 1000 stackable && adduser -u 1000 -g stackable -c 'Stackable Ope

USER stackable:stackable

ENTRYPOINT ["/stackable-{[ operator.name }]"]
ENTRYPOINT ["stackable-{[ operator.name }]"]
CMD ["run"]