-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minikube image build
should support configuring build-args
#12384
Comments
Sounds like a good idea! |
Will fix this one as well, along with env: #12431. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Using these version on Linux
...it seems that
...works 🎉. Here's a demo showing docker supports the syntax directly: $ cat Dockerfile
FROM ubuntu:20.04
ARG QQQ
RUN echo "QQQ=$QQQ" $ docker build --build-arg=QQQ=fff .
Sending build context to Docker daemon 10.24kB
Step 1/3 : FROM ubuntu:20.04
---> 2a4d239ad3cc
Step 2/3 : ARG QQQ
---> Running in aa8a3e125afd
Removing intermediate container aa8a3e125afd
---> fbd68f28e9af
Step 3/3 : RUN echo "QQQ=$QQQ"
---> Running in 8d6e55796ab4
QQQ=fff
Removing intermediate container 8d6e55796ab4
---> 7e5fea687653
Successfully built 7e5fea687653 And here's using $ minikube image build --build-opt=build-arg=QQQ=blah .
Sending build context to Docker daemon 10.24kB
Step 1/3 : FROM ubuntu:20.04
...snip pulling base image logs
---> 3bc6e9f30f51
Step 2/3 : ARG QQQ
---> Running in 43a966130990
Removing intermediate container 43a966130990
---> db3157d02c61
Step 3/3 : RUN echo "QQQ=$QQQ"
---> Running in 8aab10656d86
QQQ=blah
Removing intermediate container 8aab10656d86
---> 100b899719ee
Successfully built 100b899719ee As a workaround for the original bug report, you can get minikube to configure your docker CLI, and then write the eval $(minikube docker-env)
docker build --build-arg=QQQ=fff . |
Steps to reproduce the issue:
I'm unable to use
minikube image build
with a Dockerfile requiring build-args, using the docker runtime. I was unable to concoct a--build-opt
value that would result in a correctdocker build --build-arg key=value
command line.Minikube's underlying implementation takes the
--build-opt
arguments, prefixes them with--
and then appends the result as a single argument:minikube/pkg/minikube/cruntime/docker.go
Lines 271 to 273 in 769ee32
The other container runtimes do something similar.
Docker's command-line parser requires that the
--build-arg
key-value pairs are provided as a separate argument. It doesn't seem to support specifying build-args using a single-argument style like--build-arg=key=value
.It seems worth adding an additional
--build-arg
flag forminikube image build
:--build-arg
The text was updated successfully, but these errors were encountered: