Merge pull request #231 from EricTheMagician/docker-build
add support for more docker-compose build options
This commit is contained in:
commit
39ee2bc7f7
1 changed files with 18 additions and 2 deletions
|
@ -66,6 +66,22 @@ in
|
||||||
https://docs.docker.com/compose/compose-file/build/#context
|
https://docs.docker.com/compose/compose-file/build/#context
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
service.build.dockerfile = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Sets an alternate Dockerfile. A relative path is resolved from the build context.
|
||||||
|
https://docs.docker.com/compose/compose-file/build/#dockerfile
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
service.build.target = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Defines the stage to build as defined inside a multi-stage Dockerfile.
|
||||||
|
https://docs.docker.com/compose/compose-file/build/#target
|
||||||
|
'';
|
||||||
|
};
|
||||||
service.hostname = mkOption {
|
service.hostname = mkOption {
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -337,8 +353,8 @@ in
|
||||||
;
|
;
|
||||||
} // lib.optionalAttrs (config.service.image != null) {
|
} // lib.optionalAttrs (config.service.image != null) {
|
||||||
inherit (config.service) image;
|
inherit (config.service) image;
|
||||||
} // lib.optionalAttrs (config.service.build.context != null) {
|
} // lib.optionalAttrs (config.service.build.context != null ) {
|
||||||
inherit (config.service) build;
|
build = lib.filterAttrs (n: v: v != null) config.service.build;
|
||||||
} // lib.optionalAttrs (cap_add != []) {
|
} // lib.optionalAttrs (cap_add != []) {
|
||||||
inherit cap_add;
|
inherit cap_add;
|
||||||
} // lib.optionalAttrs (cap_drop != []) {
|
} // lib.optionalAttrs (cap_drop != []) {
|
||||||
|
|
Loading…
Reference in a new issue