diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 7be1dba..37d68e2 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -184,7 +184,7 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report. ReuseContainers: false, ForcePull: r.cfg.Container.ForcePull, - ForceRebuild: false, + ForceRebuild: r.cfg.Container.ForceRebuild, LogOutput: true, JSONLogger: false, Env: r.envs, diff --git a/internal/pkg/config/config.example.yaml b/internal/pkg/config/config.example.yaml index df4f6cc..00b5fd1 100644 --- a/internal/pkg/config/config.example.yaml +++ b/internal/pkg/config/config.example.yaml @@ -82,6 +82,8 @@ container: docker_host: "" # Pull docker image(s) even if already present force_pull: false + # Rebuild docker image(s) even if already present + force_rebuild: false host: # The parent directory of a job's working directory. diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 084de27..8a5cade 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -51,6 +51,7 @@ type Container struct { ValidVolumes []string `yaml:"valid_volumes"` // ValidVolumes specifies the volumes (including bind mounts) can be mounted to containers. DockerHost string `yaml:"docker_host"` // DockerHost specifies the Docker host. It overrides the value specified in environment variable DOCKER_HOST. ForcePull bool `yaml:"force_pull"` // Pull docker image(s) even if already present + ForceRebuild bool `yaml:"force_rebuild"` // Rebuild docker image(s) even if already present } // Host represents the configuration for the host.