feat: --container-options
(#1462)
* feat: `--container-options` This deprecates the following options - `--privileged` - `--container-cap-add` - `--container-cap-drop` - `--container-architecture` - `--userns` * Merge binds/mounts, add desc * avoid linter error * fix: apply options to step env / deprecate warning Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@@ -366,6 +366,7 @@ func newStepContainer(ctx context.Context, step step, image string, cmd []string
|
||||
Privileged: rc.Config.Privileged,
|
||||
UsernsMode: rc.Config.UsernsMode,
|
||||
Platform: rc.Config.ContainerArchitecture,
|
||||
Options: rc.Config.ContainerOptions,
|
||||
})
|
||||
return stepContainer
|
||||
}
|
||||
|
@@ -410,7 +410,7 @@ func (rc *RunContext) options(ctx context.Context) string {
|
||||
job := rc.Run.Job()
|
||||
c := job.Container()
|
||||
if c == nil {
|
||||
return ""
|
||||
return rc.Config.ContainerOptions
|
||||
}
|
||||
|
||||
return c.Options
|
||||
|
@@ -39,6 +39,7 @@ type Config struct {
|
||||
UsernsMode string // user namespace to use
|
||||
ContainerArchitecture string // Desired OS/architecture platform for running containers
|
||||
ContainerDaemonSocket string // Path to Docker daemon socket
|
||||
ContainerOptions string // Options for the job container
|
||||
UseGitIgnore bool // controls if paths in .gitignore should not be copied into container, default true
|
||||
GitHubInstance string // GitHub instance to use, default "github.com"
|
||||
ContainerCapAdd []string // list of kernel capabilities to add to the containers
|
||||
|
Reference in New Issue
Block a user