mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
Put the job container name into the env context (#62)
Related: https://gitea.com/gitea/act_runner/issues/189#issuecomment-740636 Refer to [Docker Doc](https://docs.docker.com/engine/reference/commandline/run/#volumes-from), the `--volumes-from` flag is used when running or creating a new container and takes the name or ID of the container from which you want to share volumes. Here's the syntax: ``` docker run --volumes-from <container_name_or_id> <image> ``` So put the job container name into the `env` context in this PR. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/62 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
This commit is contained in:
parent
ec225a40cd
commit
981b8c8893
1 changed files with 3 additions and 0 deletions
|
@ -263,6 +263,9 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
||||||
|
|
||||||
logger.Infof("\U0001f680 Start image=%s", image)
|
logger.Infof("\U0001f680 Start image=%s", image)
|
||||||
name := rc.jobContainerName()
|
name := rc.jobContainerName()
|
||||||
|
// For gitea, to support --volumes-from <container_name_or_id> in options.
|
||||||
|
// We need to set the container name to the environment variable.
|
||||||
|
rc.Env["JOB_CONTAINER_NAME"] = name
|
||||||
|
|
||||||
envList := make([]string, 0)
|
envList := make([]string, 0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue