PHP Deployment Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
neatoDeploy/config_files/deploy_podman.php

72 lines
2.1 KiB

<?php
configure::set('display', true); // Show Output
configure::set('logfile', false); // Save to log folder
configure::set('syslog', false);
configure::set('pre_actions', [
'make_dir' => ['/etc/containers'=>''],
'chmod_file_or_dir' =>
['/etc/containers' => 'dir'],
]);
force_root();
file_loop(configure::get('pre_actions'));
$is_podman_installed = do_command('is_installed', "podman");
if ($is_podman_installed['installed'] === false) {
do_command('install', "software-properties-common");
//do_command("add_repo", "ppa:projectatomic/ppa");
do_command('update');
do_command('install', "podman");
}
$policy = '
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
"": [{"type":"insecureAcceptAnything"}]
}
}
}';
if (! file_exists("/etc/containers/policy.json")) {
append_to_file("/etc/containers/policy.json", $policy);
chmod_file_or_dir("/etc/containers/policy.json", "config");
}
$reg = "# This is a system-wide configuration file used to
# keep track of registries for various container backends.
# It adheres to TOML format and does not support recursive
# lists of registries.
# The default location for this configuration file is /etc/containers/registries.conf.
# The only valid categories are: 'registries.search', 'registries.insecure',
# and 'registries.block'.
[registries.search]
registries = ['docker.io', 'registry.fedoraproject.org', 'registry.access.redhat.com']
# If you need to access insecure registries, add the registry's fully-qualified name.
# An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
[registries.insecure]
registries = []
# If you need to block pull access from a registry, uncomment the section below
# and add the registries fully-qualified name.
#
# Docker only
[registries.block]
registries = []";
if (! file_exists("/etc/containers/registries.conf")) {
append_to_file("/etc/containers/registries.conf", $reg);
chmod_file_or_dir("/etc/containers/registries.conf", "config");
}