You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/pkg/docker/dockerengine/dockerengine.go
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,12 @@ const (
60
60
containerStatusExited="exited"
61
61
)
62
62
63
+
// Deprecated predefined options to pass to `docker build`. The `options: [...]` config should be used instead.
64
+
const (
65
+
BuildOptionCacheFrom="--cache-from"
66
+
BuildOptionTarget="--target"
67
+
)
68
+
63
69
// DockerCmdClient represents the docker client to interact with the server via external commands.
64
70
typeDockerCmdClientstruct {
65
71
runnerCmd
@@ -85,8 +91,7 @@ type BuildArguments struct {
85
91
Dockerfilestring// Optional. One of Dockerfile or DockerfileContent is required. Dockerfile to pass to `docker build` via --file flag.
86
92
DockerfileContentstring// Optional. One of Dockerfile or DockerfileContent is required. Dockerfile content to pass to `docker build` via stdin.
87
93
Contextstring// Optional. Build context directory to pass to `docker build`.
88
-
Targetstring// Optional. The target build stage to pass to `docker build`.
89
-
CacheFrom []string// Optional. Images to consider as cache sources to pass to `docker build`
94
+
Options []string// Optional. Additional build options and flags to pass to `docker build`. See https://docs.docker.com/reference/cli/docker/image/build/#options
90
95
Platformstring// Optional. OS/Arch to pass to `docker build`.
91
96
Argsmap[string]string// Optional. Build args to pass via `--build-arg` flags. Equivalent to ARG directives in dockerfile.
92
97
Labelsmap[string]string// Required. Set metadata for an image.
@@ -130,21 +135,16 @@ func (in *BuildArguments) GenerateDockerBuildArgs(c DockerCmdClient) ([]string,
130
135
131
136
args:= []string{"build"}
132
137
138
+
// Add all custom options first.
139
+
for_, option:=rangein.Options {
140
+
args=append(args, option)
141
+
}
142
+
133
143
// Add additional image tags to the docker build call.
0 commit comments