From 3e3981ba6cb11e4394ca9f046a30484e3c3284de Mon Sep 17 00:00:00 2001 From: Magnus Andersson Date: Tue, 23 Jan 2024 22:03:05 +0100 Subject: [PATCH] Prepare runner image build --- manifests/runner.pp | 20 ++++++++++++++++++-- templates/runnerimage-Containerfile.erb | 7 +++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 templates/runnerimage-Containerfile.erb diff --git a/manifests/runner.pp b/manifests/runner.pp index 8c56700..3102c54 100644 --- a/manifests/runner.pp +++ b/manifests/runner.pp @@ -29,7 +29,7 @@ class podmanrunner::runner ( content => template('podmanrunner/docker-compose.yaml.erb'), owner => "${username}${x}", group => "${username}${x}", - mode => '0600', + mode => '0400', } file { "/opt/${username}${x}/bin": @@ -41,11 +41,27 @@ class podmanrunner::runner ( file { "/opt/${username}${x}/bin/podman-compose": ensure => file, - mode => '500', + mode => '0500', source => 'puppet:///modules/podmanrunner/podman-compose', owner => "${username}${x}", group => "${username}${x}", } + + file { "/opt/${username}${x}/runnerimage": + ensure => directory, + mode => '0700', + owner => "${username}${x}", + group => "${username}${x}", + } + + file { "/opt/${username}${x}/runnerimage/Containerfile": + ensure => file, + content => template('podmanrunner/runnerimage-Containerfile.erb'), + owner => "${username}${x}", + group => "${username}${x}", + mode => '0400', + } + exec { "enable-${username}${x}-linger": command => "loginctl enable-linger ${username}${x}", path => '/usr/bin:/usr/sbin:/bin', diff --git a/templates/runnerimage-Containerfile.erb b/templates/runnerimage-Containerfile.erb new file mode 100644 index 0000000..a34e229 --- /dev/null +++ b/templates/runnerimage-Containerfile.erb @@ -0,0 +1,7 @@ +FROM code.forgejo.org/forgejo/runner:3.3.0 as runner +FROM quay.io/podman/stable:v4.8.3 +COPY --from=runner /bin/forgejo-runner /bin/forgejo-runner +RUN dnf -y install nodejs git +VOLUME ["/data"] +WORKDIR /home/podman +CMD ["/bin/forgejo-runner","daemon","--config","/data/config.yml"]