Put the job container name into the env context #62

Merged
lunny merged 3 commits from sillyguodong/act:add_env_of_job_container_name into main 2023-06-06 00:21:33 +00:00
Member

Related: gitea/act_runner#189 (comment)
Refer to Docker Doc, 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.

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.
sillyguodong added 1 commit 2023-06-02 09:22:06 +00:00
Put the job container name into the env
All checks were successful
checks / check and test (pull_request) Successful in 46s
8f56fd068c
wxiaoguang reviewed 2023-06-02 10:27:59 +00:00
@ -255,6 +255,7 @@ func (rc *RunContext) startJobContainer() common.Executor {
logger.Infof("\U0001f680 Start image=%s", image)
name := rc.jobContainerName()
rc.Env["JOB_CONTAINER_NAME"] = name
Member

Is startHostEnvironment the right place for preparing rc.Env ?

Is `startHostEnvironment` the right place for preparing `rc.Env` ?
First-time contributor

No, startHostEnvironment doesn't create a docker job container at all and is used for creating a fake container structure to run all commands without docker on the host.

No, startHostEnvironment doesn't create a docker job container at all and is used for creating a fake container structure to run all commands without docker on the host.
sillyguodong marked this conversation as resolved
sillyguodong added 1 commit 2023-06-05 09:57:25 +00:00
add comment
All checks were successful
checks / check and test (pull_request) Successful in 30s
deabc6dee2
wolfogre approved these changes 2023-06-05 10:00:08 +00:00
wolfogre added 1 commit 2023-06-05 10:00:19 +00:00
Merge branch 'main' into add_env_of_job_container_name
All checks were successful
checks / check and test (pull_request) Successful in 27s
c961c98026
lunny merged commit 6ce5c93cc8 into main 2023-06-06 00:21:33 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/act#62
No description provided.