Prepare runner image build

This commit is contained in:
Magnus Andersson 2024-01-23 22:03:05 +01:00
parent 9d164c16a5
commit 3e3981ba6c
Signed by: mandersson
GPG key ID: 19CB2C58E1F19B16
2 changed files with 25 additions and 2 deletions

View file

@ -29,7 +29,7 @@ class podmanrunner::runner (
content => template('podmanrunner/docker-compose.yaml.erb'), content => template('podmanrunner/docker-compose.yaml.erb'),
owner => "${username}${x}", owner => "${username}${x}",
group => "${username}${x}", group => "${username}${x}",
mode => '0600', mode => '0400',
} }
file { "/opt/${username}${x}/bin": file { "/opt/${username}${x}/bin":
@ -41,11 +41,27 @@ class podmanrunner::runner (
file { "/opt/${username}${x}/bin/podman-compose": file { "/opt/${username}${x}/bin/podman-compose":
ensure => file, ensure => file,
mode => '500', mode => '0500',
source => 'puppet:///modules/podmanrunner/podman-compose', source => 'puppet:///modules/podmanrunner/podman-compose',
owner => "${username}${x}", owner => "${username}${x}",
group => "${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": exec { "enable-${username}${x}-linger":
command => "loginctl enable-linger ${username}${x}", command => "loginctl enable-linger ${username}${x}",
path => '/usr/bin:/usr/sbin:/bin', path => '/usr/bin:/usr/sbin:/bin',

View file

@ -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"]