lib/builders: fix Docker builder
Some checks failed
Build devcontainers / build-devcontainers (push) Has been cancelled
Cache outputs / build-custom-packages (push) Has been cancelled
Check flake outputs / check-outputs (push) Has been cancelled
Publish every Git push to master to FlakeHub / flakehub-publish (push) Has been cancelled
Build personalized bootstrap ISO / build-iso (x86_64-linux) (push) Has been cancelled
Build project site / build (push) Has been cancelled
Build project site / deploy (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled

This commit is contained in:
Gabriel Arazas 2025-03-17 08:12:53 +08:00
parent a13217867f
commit 0de1441342
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -1,8 +1,11 @@
{ dockerTools, foodogsquaredLib }:
{ dockerTools, lib, foodogsquaredLib }:
{ name, contents ? [ ], pathsToLink ? [ ], enableTypicalSetup ? true, ... }@attrs:
dockerTools.buildImage (attrs // {
let
attrs' = lib.removeAttrs attrs [ "contents" "pathsToLink" "enableTypicalSetup" "name" ];
in
dockerTools.buildImage (attrs' // {
name = "fds-${name}";
copyToRoot = foodogsquaredLib.buildFDSEnv {
@ -22,10 +25,10 @@ dockerTools.buildImage (attrs // {
${lib.optionalString enableTypicalSetup ''
mkdir -p /data
''}
${attrs.runAsRoot}
${attrs.runAsRoot or ""}
'';
config = attrs.config // lib.optionalAttrs enableTypicalSetup {
config = (attrs.config or {}) // lib.optionalAttrs enableTypicalSetup {
Cmd = [ "/bin/bash" ];
WorkingDir = "/data";
Volumes."/data" = { };