9283cfc9b1
Follow: https://gitea.com/gitea/act_runner/pulls/184 Close https://gitea.com/gitea/act_runner/issues/177 #### changes: - `act` create new networks only if the value of `NeedCreateNetwork` is true, and remove these networks at last. `NeedCreateNetwork` is passed by `act_runner`. 'NeedCreateNetwork' is true only if `container.network` in the configuration file of the `act_runner` is empty. - In the `docker create` phase, specify the network to which containers will connect. Because, if not specify , container will connect to `bridge` network which is created automatically by Docker. - If the network is user defined network ( the value of `container.network` is empty or `<custom-network>`. Because, the network created by `act` is also user defined network.), will also specify alias by `--network-alias`. The alias of service is `<service-id>`. So we can be access service container by `<service-id>:<port>` in the steps of job. - Won't try to `docker network connect ` network after `docker start` any more. - Because on the one hand, `docker network connect` applies only to user defined networks, if try to `docker network connect host <container-name>` will return error. - On the other hand, we just specify network in the stage of `docker create`, the same effect can be achieved. - Won't try to remove containers and networks berfore the stage of `docker start`, because the name of these containers and netwoks won't be repeat. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/56 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com> |
||
---|---|---|
.. | ||
res | ||
testdata | ||
action.go | ||
action_composite.go | ||
action_test.go | ||
command.go | ||
command_test.go | ||
container_mock_test.go | ||
expression.go | ||
expression_test.go | ||
job_executor.go | ||
job_executor_test.go | ||
logger.go | ||
reusable_workflow.go | ||
run_context.go | ||
run_context_test.go | ||
runner.go | ||
runner_test.go | ||
step.go | ||
step_action_local.go | ||
step_action_local_test.go | ||
step_action_remote.go | ||
step_action_remote_test.go | ||
step_docker.go | ||
step_docker_test.go | ||
step_factory.go | ||
step_factory_test.go | ||
step_run.go | ||
step_run_test.go | ||
step_test.go |