Add configuration item of container.network
#184
No reviewers
Labels
No Label
kind
bug
kind
build
kind/compatible
kind
dependencies
kind
docs
kind
enhancement
kind
feature
kind
help wanted
kind
proposal
kind
refactor
related
act
related
environment
related
exec
related
gitea
related
workflow
reviewed
confirmed
reviewed
duplicate
reviewed
invalid
reviewed
needs feedback
reviewed
wontfix
reviewed
workaround
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/act_runner#184
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "sillyguodong/act_runner:feature/container_network"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #177
Related gitea/act#56
⚠️ Breaking
The
container.network_mode
is a deprecated configuration item. It may be removed after Gitea 1.20 released.Previously, if the value of
container.network_mode
isbridge
, it means thatact_runner
will create a new network for job.Butbridge
is easily confused with the bridge network created by Docker by default.We recommand that using
container.network
to specify the network to which containers created byact_runner
connect.🆕 container.network
The configuration file of
act_runner
add a new item ofcontianer.network
.(Please make sure thatcontainer.network_mode
not exists in configuration file.)In
config.example.yaml
:As the comment in the example above says, the purpose of the
container.network
is specifying the network to which containers created byact_runner
will connect.container.network
accepts the following valid values:host
: All of containers (including job containers and service contianers) created byact_runner
will be connected to the network namedhost
which is created automatically by Docker. Containers will share the host’s network stack and all interfaces from the host will be available to these containers.bridge
: It is similar tohost
. All of containers created byact_runner
will be connected to the network namedbridge
which is created automatically by Docker. All containers connected to thebridge
(Perhaps there are containers that are not created byact_runner
) are allowed to communicate with each other, while providing isolation from containers which are not connected to thatbridge
network.<custom_network>
: Please make sure that the<custom_network>
network already exists firstly (act_runner
does not detect whether the specified network exists currently. If not exists yet, will return error in the stage ofdocker create
). All of containers created byact_runner
will be connected to<custom_network>
. After the job is executed, containers are removed and automatically disconnected from the<custom_network>
.act_runner
will create a new network for each job container and their service containers (if defined in workflow). So each job container and their service containers share a network environment, but are isolated from others container and the Docker host. Of course, these networks created byact_runner
will be removed at last.Others
container.network
to empty string (and do not usecontainer.network_mode
any more). Because the containers created byact_runner
will connect to the networks that are created by itself. This point will provide better isolation.contianer.network
to empty string or<custom_network>
, we can be access to service containers by<service-id>:<port>
in the steps of job. Because we added an alias to the service container when connecting to the network.container.network_mode
Switch the type of `ContainerNetworkMode` to `container.NetworkMode`to Add configuration item of `container.network`@ -36,2 +36,3 @@
Container struct {
NetworkMode string `yaml:"network_mode"`
Network string `yaml:"network"`
NetworkMode string `yaml:"network_mode"` // leagcy, but will be abandoned in future, be replace by network.