mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-20 06:42:34 +00:00
Don't use runner binaries, instead document job container requirements
This commit is contained in:
@@ -104,7 +104,7 @@ export async function runContainerStep(
|
||||
try {
|
||||
core.debug(`Executing container step script in pod ${podName}`)
|
||||
return await execPodStep(
|
||||
['/__e/sh', '-e', containerPath],
|
||||
['sh', '-e', containerPath],
|
||||
pod.metadata.name,
|
||||
JOB_CONTAINER_NAME
|
||||
)
|
||||
@@ -133,7 +133,7 @@ function createContainerSpec(
|
||||
podContainer.name = JOB_CONTAINER_NAME
|
||||
podContainer.image = container.image
|
||||
podContainer.workingDir = '/__w'
|
||||
podContainer.command = ['/__e/tail']
|
||||
podContainer.command = ['tail']
|
||||
podContainer.args = DEFAULT_CONTAINER_ENTRY_POINT_ARGS
|
||||
|
||||
podContainer.volumeMounts = CONTAINER_VOLUMES
|
||||
|
||||
@@ -169,41 +169,10 @@ export async function createContainerStepPod(
|
||||
|
||||
appPod.spec = new k8s.V1PodSpec()
|
||||
appPod.spec.containers = [container]
|
||||
appPod.spec.initContainers = [
|
||||
{
|
||||
name: 'fs-init',
|
||||
image:
|
||||
process.env.ACTIONS_RUNNER_IMAGE ||
|
||||
'ghcr.io/actions/actions-runner:latest',
|
||||
command: [
|
||||
'bash',
|
||||
'-c',
|
||||
`sudo cp $(which sh) /mnt/externals/sh \
|
||||
&& sudo cp $(which tail) /mnt/externals/tail \
|
||||
&& sudo cp $(which env) /mnt/externals/env \
|
||||
&& sudo chmod -R 777 /mnt/externals`
|
||||
],
|
||||
securityContext: {
|
||||
runAsGroup: 1001,
|
||||
runAsUser: 1001,
|
||||
privileged: true
|
||||
},
|
||||
volumeMounts: [
|
||||
{
|
||||
name: EXTERNALS_VOLUME_NAME,
|
||||
mountPath: '/mnt/externals'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
appPod.spec.restartPolicy = 'Never'
|
||||
|
||||
appPod.spec.volumes = [
|
||||
{
|
||||
name: EXTERNALS_VOLUME_NAME,
|
||||
emptyDir: {}
|
||||
},
|
||||
{
|
||||
name: GITHUB_VOLUME_NAME,
|
||||
emptyDir: {}
|
||||
|
||||
Reference in New Issue
Block a user