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;








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









share|improve this question
























  • 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


















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









share|improve this question
























  • 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














0












0








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









share|improve this question
















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 kubernetes google-cloud-platform kaniko






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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













2 Answers
2






active

oldest

votes


















0














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?.






share|improve this answer






























    0














    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





    share|improve this answer

























      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
      );



      );













      draft saved

      draft discarded


















      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









      0














      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?.






      share|improve this answer



























        0














        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?.






        share|improve this answer

























          0












          0








          0







          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?.






          share|improve this answer













          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?.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 31 at 11:31









          HanxHanx

          4968 bronze badges




          4968 bronze badges























              0














              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





              share|improve this answer



























                0














                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





                share|improve this answer

























                  0












                  0








                  0







                  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





                  share|improve this answer













                  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






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  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



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                      155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해