mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-13 19:33:41 +00:00
Add CLI flag for specifying the Docker image to use. (#83)
Since the `exec` command does not use labels from `.runner`, there is no existing way to specify which Docker image to use for task execution. This adds an `--image` flag for specifying it manually. The default remains `node:16-bullseye`. Co-authored-by: Lunny Xiao <[email protected]> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/83 Reviewed-by: Jason Song <[email protected]> Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: telackey <[email protected]> Co-committed-by: telackey <[email protected]>
This commit is contained in:
1 parent
c8fad20f49
commit
8eea12dd78
1 file changed
+3
-1
+3
-1
@@ -54,6 +54,7 @@ type executeArgs struct {
|
|||||||
noSkipCheckout bool
|
noSkipCheckout bool
|
||||||
debug bool
|
debug bool
|
||||||
dryrun bool
|
dryrun bool
|
||||||
|
image string
|
||||||
cacheHandler *artifactcache.Handler
|
cacheHandler *artifactcache.Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,7 +386,7 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||||||
ContainerNetworkMode: "bridge",
|
ContainerNetworkMode: "bridge",
|
||||||
DefaultActionInstance: execArgs.defaultActionsUrl,
|
DefaultActionInstance: execArgs.defaultActionsUrl,
|
||||||
PlatformPicker: func(_ []string) string {
|
PlatformPicker: func(_ []string) string {
|
||||||
return "node:16-bullseye"
|
return execArgs.image
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,6 +462,7 @@ func loadExecCmd(ctx context.Context) *cobra.Command {
|
|||||||
execCmd.PersistentFlags().BoolVarP(&execArg.noSkipCheckout, "no-skip-checkout", "", false, "Do not skip actions/checkout")
|
execCmd.PersistentFlags().BoolVarP(&execArg.noSkipCheckout, "no-skip-checkout", "", false, "Do not skip actions/checkout")
|
||||||
execCmd.PersistentFlags().BoolVarP(&execArg.debug, "debug", "d", false, "enable debug log")
|
execCmd.PersistentFlags().BoolVarP(&execArg.debug, "debug", "d", false, "enable debug log")
|
||||||
execCmd.PersistentFlags().BoolVarP(&execArg.dryrun, "dryrun", "n", false, "dryrun mode")
|
execCmd.PersistentFlags().BoolVarP(&execArg.dryrun, "dryrun", "n", false, "dryrun mode")
|
||||||
|
execCmd.PersistentFlags().StringVarP(&execArg.image, "image", "i", "node:16-bullseye", "docker image to use")
|
||||||
|
|
||||||
return execCmd
|
return execCmd
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user