mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-24 07:45:02 +01:00
fix: step container workdir and mounts (#93)
* fix: step container workdir and mounts * avoid perm issues and do not mount tool_cache
This commit is contained in:
@@ -382,13 +382,18 @@ func newStepContainer(ctx context.Context, step step, image string, cmd []string
|
||||
|
||||
binds, mounts := rc.GetBindsAndMounts()
|
||||
networkMode := fmt.Sprintf("container:%s", rc.jobContainerName())
|
||||
var workdir string
|
||||
if rc.IsHostEnv(ctx) {
|
||||
networkMode = "default"
|
||||
ext := container.LinuxContainerEnvironmentExtensions{}
|
||||
workdir = ext.ToContainerPath(rc.Config.Workdir)
|
||||
} else {
|
||||
workdir = rc.JobContainer.ToContainerPath(rc.Config.Workdir)
|
||||
}
|
||||
stepContainer := container.NewContainer(&container.NewContainerInput{
|
||||
Cmd: cmd,
|
||||
Entrypoint: entrypoint,
|
||||
WorkingDir: rc.JobContainer.ToContainerPath(rc.Config.Workdir),
|
||||
WorkingDir: workdir,
|
||||
Image: image,
|
||||
Username: rc.Config.Secrets["DOCKER_USERNAME"],
|
||||
Password: rc.Config.Secrets["DOCKER_PASSWORD"],
|
||||
|
||||
Reference in New Issue
Block a user