Fix container network issue #56
No reviewers
Labels
No Label
duplicate
help wanted
invalid
kind
bug
kind
enhancement
kind
feature
kind
question
proposal
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/act#56
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "sillyguodong/act:feature/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?
Follow: gitea/act_runner#184
Close gitea/act_runner#177
changes:
act
create new networks only if the value ofContainerNetworkMode
which is passed byact_runner
is empty string, and remove these networks at last.docker create
phase, specify the network to which containers will connect. Because, if not specify , container will connect tobridge
network which is created automatically by Docker.container.network
is empty or<custom-network>
. Because, the network created byact
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.docker network connect
network afterdocker start
any more.docker network connect
applies only to user defined networks, if try todocker network connect host <container-name>
will return error.docker create
, the same effect can be achieved.docker start
, because the name of these containers and netwoks won't be repeat.WIP: Fix container network issueto Fix container network issue@ -77,6 +78,27 @@ func (c Config) GetToken() string {
return token
}
func (c Config) IsNetworkModeHost() bool {
Maybe we could reuse
container.NetworkMode
sillyguodong referenced this pull request from gitea/act_runner2023-05-12 08:35:24 +00:00
@ -265,0 +267,4 @@
networkName = fmt.Sprintf("%s-network", rc.jobContainerName())
} else {
networkName = string(*rc.Config.ContainerNetworkMode)
}
Maybe
@ -69,0 +62,4 @@
EventJSON string // the content of JSON file to use for event.json in containers, overrides EventPath
ContainerNamePrefix string // the prefix of container name
ContainerMaxLifetime time.Duration // the max lifetime of job containers
ContainerNetworkMode *docker_container.NetworkMode // the network mode of job containers
Why not
docker_container.NetworkMode
instead of*docker_container.NetworkMode