error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfileKubernetes equivalent of env-file in DockerHow to map one single file into kubernetes pod using hostPath?Kubernetes doesn't allow to mount file to containerGoogle Kubernetes Engine: Not seeing mount persistent volume in the instanceDockerizing Spring boot application for Kubernetes DeploymentHow to mount a volume with a windows container in kubernetes?Share nfs volume between kubernetes clustersNot able to see Pod when I create a JobHow to pull docker images hosted on Google Container Registry via Kubernetes (kubernetes included on docker for desktop)kubeadm install flannel get error, what's wrong?
Do aircraft cabins have suspension?
What is this called? A tube flange bearing threaded for threaded pushrod
What are some symbols representing peasants/oppressed persons fighting back?
Why should I cook the flour first when making bechamel sauce?
Is dividends exclusively a part of earnings?
Why is "dark" an adverb in this sentence?
Re-negotiate salary once I earn my diploma
What made Windows ME so crash-prone?
Can a pizza stone be fixed after soap has been used to clean it?
Why doesn't philosophy have higher standards for its arguments?
Align by center of symbol
Find maximum according to a parameter
@track not working in connectedCallback
Concentration in the Planes
What is the technical explanation of the note "A♭" in a F7 chord in the key of C?
Getting fresh water in the middle of hypersaline lake in the Bronze Age
line break after the word "proof" in proof environment
I quit, and boss offered me 3 month "grace period" where I could still come back
Used PowerShell to change my RHEL root passwords via PuTTY, but I don't know what I changed my password to
Adding a vertical line at the right end of the horizontal line in frac
How to honestly answer questions from a girlfriend like "How did you find this place" without giving the impression I'm always talking about my exes?
Why don't commercial aircraft adopt a slightly more seaplane-like design to allow safer ditching in case of emergency?
why run a service as a system user?
Can a British citizen travel with a Nigerian passport?
error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Kubernetes equivalent of env-file in DockerHow to map one single file into kubernetes pod using hostPath?Kubernetes doesn't allow to mount file to containerGoogle Kubernetes Engine: Not seeing mount persistent volume in the instanceDockerizing Spring boot application for Kubernetes DeploymentHow to mount a volume with a windows container in kubernetes?Share nfs volume between kubernetes clustersNot able to see Pod when I create a JobHow to pull docker images hosted on Google Container Registry via Kubernetes (kubernetes included on docker for desktop)kubeadm install flannel get error, what's wrong?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
apiVersion: v1
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args:
- "--context=dir:///workspace"
- "--dockerfile=/workspace/Dockerfile"
- "--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret.json
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: kaniko-secret
- name: context
hostPath:
path: /home/sabadsulla/kanikodir
I am running kaniko on a kubernetes pod to build a docker image and pushing to the GCR.
When i use google cloud storage for the CONTEXT_PATH it works fine ,
But i need to use the Local_directory(meaning using the shared volumes of the pods) AS the CONTEXT_PATH
it throws an error
"Error: error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Usage:
I tried with args "--context=/workspace" , "--context=dir://workspace" , it gives the same error
docker
add a comment |
apiVersion: v1
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args:
- "--context=dir:///workspace"
- "--dockerfile=/workspace/Dockerfile"
- "--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret.json
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: kaniko-secret
- name: context
hostPath:
path: /home/sabadsulla/kanikodir
I am running kaniko on a kubernetes pod to build a docker image and pushing to the GCR.
When i use google cloud storage for the CONTEXT_PATH it works fine ,
But i need to use the Local_directory(meaning using the shared volumes of the pods) AS the CONTEXT_PATH
it throws an error
"Error: error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Usage:
I tried with args "--context=/workspace" , "--context=dir://workspace" , it gives the same error
docker
You should format the question properly so that it is readable and looks neat and is understandable, may be also provide brief background etc. You may use preview option before submitting. This will help you get best solutions/answers from the community and may be some upvotes too!
– Rajesh Gupta
Mar 26 at 7:28
Hi, Please describe the problem, what you have done and use code formatting in order to get more attention to your question.
– Veerendra
Mar 26 at 7:29
/workspace directory exists on the local server ?
– error404
Mar 26 at 7:58
/workspace does not exist on local server , it exists on the pod . @error404
– user8024713
Mar 26 at 8:11
add a comment |
apiVersion: v1
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args:
- "--context=dir:///workspace"
- "--dockerfile=/workspace/Dockerfile"
- "--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret.json
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: kaniko-secret
- name: context
hostPath:
path: /home/sabadsulla/kanikodir
I am running kaniko on a kubernetes pod to build a docker image and pushing to the GCR.
When i use google cloud storage for the CONTEXT_PATH it works fine ,
But i need to use the Local_directory(meaning using the shared volumes of the pods) AS the CONTEXT_PATH
it throws an error
"Error: error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Usage:
I tried with args "--context=/workspace" , "--context=dir://workspace" , it gives the same error
docker
apiVersion: v1
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args:
- "--context=dir:///workspace"
- "--dockerfile=/workspace/Dockerfile"
- "--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret.json
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: kaniko-secret
- name: context
hostPath:
path: /home/sabadsulla/kanikodir
I am running kaniko on a kubernetes pod to build a docker image and pushing to the GCR.
When i use google cloud storage for the CONTEXT_PATH it works fine ,
But i need to use the Local_directory(meaning using the shared volumes of the pods) AS the CONTEXT_PATH
it throws an error
"Error: error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Usage:
I tried with args "--context=/workspace" , "--context=dir://workspace" , it gives the same error
docker
docker
edited Mar 26 at 10:28
error404
1,1922 gold badges5 silver badges13 bronze badges
1,1922 gold badges5 silver badges13 bronze badges
asked Mar 26 at 7:20
user8024713user8024713
214 bronze badges
214 bronze badges
You should format the question properly so that it is readable and looks neat and is understandable, may be also provide brief background etc. You may use preview option before submitting. This will help you get best solutions/answers from the community and may be some upvotes too!
– Rajesh Gupta
Mar 26 at 7:28
Hi, Please describe the problem, what you have done and use code formatting in order to get more attention to your question.
– Veerendra
Mar 26 at 7:29
/workspace directory exists on the local server ?
– error404
Mar 26 at 7:58
/workspace does not exist on local server , it exists on the pod . @error404
– user8024713
Mar 26 at 8:11
add a comment |
You should format the question properly so that it is readable and looks neat and is understandable, may be also provide brief background etc. You may use preview option before submitting. This will help you get best solutions/answers from the community and may be some upvotes too!
– Rajesh Gupta
Mar 26 at 7:28
Hi, Please describe the problem, what you have done and use code formatting in order to get more attention to your question.
– Veerendra
Mar 26 at 7:29
/workspace directory exists on the local server ?
– error404
Mar 26 at 7:58
/workspace does not exist on local server , it exists on the pod . @error404
– user8024713
Mar 26 at 8:11
You should format the question properly so that it is readable and looks neat and is understandable, may be also provide brief background etc. You may use preview option before submitting. This will help you get best solutions/answers from the community and may be some upvotes too!
– Rajesh Gupta
Mar 26 at 7:28
You should format the question properly so that it is readable and looks neat and is understandable, may be also provide brief background etc. You may use preview option before submitting. This will help you get best solutions/answers from the community and may be some upvotes too!
– Rajesh Gupta
Mar 26 at 7:28
Hi, Please describe the problem, what you have done and use code formatting in order to get more attention to your question.
– Veerendra
Mar 26 at 7:29
Hi, Please describe the problem, what you have done and use code formatting in order to get more attention to your question.
– Veerendra
Mar 26 at 7:29
/workspace directory exists on the local server ?
– error404
Mar 26 at 7:58
/workspace directory exists on the local server ?
– error404
Mar 26 at 7:58
/workspace does not exist on local server , it exists on the pod . @error404
– user8024713
Mar 26 at 8:11
/workspace does not exist on local server , it exists on the pod . @error404
– user8024713
Mar 26 at 8:11
add a comment |
2 Answers
2
active
oldest
votes
using kaniko container and volume mounted as persistent volume claim.
Please try and use"--dockerfile=./Dockerfile"
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: ["--dockerfile=./Dockerfile",
"--context=/workspace/",
"--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace/
Using the default values:
--dockerfile string -Path to the dockerfile to be built. (default "Dockerfile")
--context string -Path to the dockerfile build context. (default "/workspace/")
Even this one statement works:args: ["--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
Hope this help. Could you please test it and share with the results?.
add a comment |
the folder looks like
In host:
/home/sabadsulla/kanikodir/Dockerfile
When it turns to PV/PVC, in pod container
/workspace/Dockerfile
Then for kanino executor, if we map the context to workspace, the dockerfile will be related to context is Dockerfile, so
--context=/workspace
--dockerfile=Dockerfile
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351690%2ferror-resolving-dockerfile-path-please-provide-a-valid-path-to-a-dockerfile-wit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
using kaniko container and volume mounted as persistent volume claim.
Please try and use"--dockerfile=./Dockerfile"
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: ["--dockerfile=./Dockerfile",
"--context=/workspace/",
"--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace/
Using the default values:
--dockerfile string -Path to the dockerfile to be built. (default "Dockerfile")
--context string -Path to the dockerfile build context. (default "/workspace/")
Even this one statement works:args: ["--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
Hope this help. Could you please test it and share with the results?.
add a comment |
using kaniko container and volume mounted as persistent volume claim.
Please try and use"--dockerfile=./Dockerfile"
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: ["--dockerfile=./Dockerfile",
"--context=/workspace/",
"--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace/
Using the default values:
--dockerfile string -Path to the dockerfile to be built. (default "Dockerfile")
--context string -Path to the dockerfile build context. (default "/workspace/")
Even this one statement works:args: ["--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
Hope this help. Could you please test it and share with the results?.
add a comment |
using kaniko container and volume mounted as persistent volume claim.
Please try and use"--dockerfile=./Dockerfile"
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: ["--dockerfile=./Dockerfile",
"--context=/workspace/",
"--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace/
Using the default values:
--dockerfile string -Path to the dockerfile to be built. (default "Dockerfile")
--context string -Path to the dockerfile build context. (default "/workspace/")
Even this one statement works:args: ["--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
Hope this help. Could you please test it and share with the results?.
using kaniko container and volume mounted as persistent volume claim.
Please try and use"--dockerfile=./Dockerfile"
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: ["--dockerfile=./Dockerfile",
"--context=/workspace/",
"--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
volumeMounts:
- name: kaniko-secret
mountPath: /secret
- name: context
mountPath: /workspace/
Using the default values:
--dockerfile string -Path to the dockerfile to be built. (default "Dockerfile")
--context string -Path to the dockerfile build context. (default "/workspace/")
Even this one statement works:args: ["--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest"]
Hope this help. Could you please test it and share with the results?.
answered Mar 31 at 11:31
HanxHanx
4968 bronze badges
4968 bronze badges
add a comment |
add a comment |
the folder looks like
In host:
/home/sabadsulla/kanikodir/Dockerfile
When it turns to PV/PVC, in pod container
/workspace/Dockerfile
Then for kanino executor, if we map the context to workspace, the dockerfile will be related to context is Dockerfile, so
--context=/workspace
--dockerfile=Dockerfile
add a comment |
the folder looks like
In host:
/home/sabadsulla/kanikodir/Dockerfile
When it turns to PV/PVC, in pod container
/workspace/Dockerfile
Then for kanino executor, if we map the context to workspace, the dockerfile will be related to context is Dockerfile, so
--context=/workspace
--dockerfile=Dockerfile
add a comment |
the folder looks like
In host:
/home/sabadsulla/kanikodir/Dockerfile
When it turns to PV/PVC, in pod container
/workspace/Dockerfile
Then for kanino executor, if we map the context to workspace, the dockerfile will be related to context is Dockerfile, so
--context=/workspace
--dockerfile=Dockerfile
the folder looks like
In host:
/home/sabadsulla/kanikodir/Dockerfile
When it turns to PV/PVC, in pod container
/workspace/Dockerfile
Then for kanino executor, if we map the context to workspace, the dockerfile will be related to context is Dockerfile, so
--context=/workspace
--dockerfile=Dockerfile
answered Apr 26 at 12:47
Larry CaiLarry Cai
22.5k24 gold badges85 silver badges130 bronze badges
22.5k24 gold badges85 silver badges130 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351690%2ferror-resolving-dockerfile-path-please-provide-a-valid-path-to-a-dockerfile-wit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You should format the question properly so that it is readable and looks neat and is understandable, may be also provide brief background etc. You may use preview option before submitting. This will help you get best solutions/answers from the community and may be some upvotes too!
– Rajesh Gupta
Mar 26 at 7:28
Hi, Please describe the problem, what you have done and use code formatting in order to get more attention to your question.
– Veerendra
Mar 26 at 7:29
/workspace directory exists on the local server ?
– error404
Mar 26 at 7:58
/workspace does not exist on local server , it exists on the pod . @error404
– user8024713
Mar 26 at 8:11