Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from jouvin/docker_updates
features/docker: add support for EL8 and for adding an extra YUM repository
- Loading branch information
Showing
6 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
unique template features/docker/el8/config; | ||
|
||
variable DOCKER_PACKAGE ?= 'docker-ce'; | ||
|
||
|
||
@{ | ||
descr = options for the daemon.json | ||
values = dict | ||
default = data-root if defined (DOCKER_DATA_DIR variable) | ||
required = No | ||
} | ||
variable DOCKER_SRV_OPTS ?= dict(); | ||
|
||
variable DOCKER_SRV_OPTS = { | ||
if ( is_defined(DOCKER_DATA_DIR) ) { | ||
SELF['data-root'] = DOCKER_DATA_DIR; | ||
if ( !is_defined(SELF['storage-driver']) ) { | ||
SELF['storage-driver'] = "overlay"; | ||
}; | ||
}; | ||
|
||
SELF; | ||
}; | ||
|
||
# Configure daemon.json if needed | ||
include if( length(DOCKER_SRV_OPTS) > 0 ) 'features/docker/el7/daemon_config'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
unique template features/docker/el8/daemon_config; | ||
|
||
@{ | ||
descr = daemon.json content | ||
values = string | ||
default = built using DOCKER_SRV_OPTS | ||
required = No | ||
} | ||
variable DOCKER_DAEMON_CFG_CONTENT ?= { | ||
txt = "{\n"; | ||
i = 1; | ||
foreach (name; value; DOCKER_SRV_OPTS) { | ||
if ( i < length(DOCKER_SRV_OPTS) ) { | ||
sep = ",\n"; | ||
} else { | ||
sep = "\n"; | ||
}; | ||
if(is_string(value)){ | ||
txt = txt + format('"%s": "%s"%s', name, value, sep); | ||
}else{ | ||
txt = txt + format('"%s": %s%s', name, value, sep); | ||
}; | ||
i = i + 1; | ||
}; | ||
txt = txt + "}\n"; | ||
txt; | ||
}; | ||
|
||
# Create daemon config file | ||
include 'components/filecopy/config'; | ||
prefix '/software/components/filecopy/services'; | ||
'{/etc/docker/daemon.json}' = dict("config", DOCKER_DAEMON_CFG_CONTENT, | ||
"perms", "0644", | ||
"restart", "systemctl restart docker", | ||
); | ||
|
||
|