Wercker's internal/docker-build fails with context property












0















I have a project, where I intend to build and publish more than one Docker images with wercker. The source code for each of these are in their separate folders inside the project.



To serve as a simpler example I have created a repository, where you can reproduce this problem. I used an wercker's internal/docker-build. In the link it is clear there is a context property context, but it doesn't seem to have an effect: the context still seems to be the root of my project.



My folder structure:




  • Root:


    • flask-app


      • app.py

      • requirements.txt

      • Dockerfile



    • wercker.yml




My wercker.yml file:



box:
id: python:2.7-slim
ports:
- "5000"

build:
steps:
- internal/docker-build:
dockerfile: flask-app/Dockerfile
context: flask-app
image-name: flask-app


When I run wercker build --pipeline build in the project root, the output:



--> No Docker host specified, checking: /var/run/docker.sock
--> Executing pipeline
--> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
--> Copied working directory: 0.00s
--> Running step: setup environment
Pulling from library/python: 2.7-slim
Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
Status: Image is up to date for python:2.7-slim
--> Copying source to container
--> Running step: wercker-init
--> Running step: docker build
Step 1/7 : FROM python:3.6-alpine
Pulling from library/python: 3.6-alpine
Digest: sha256:4ae5142f052c4efd0bede8483f8ca43a73e8fcfce5dbf8f581967c2c9bac597b
Status: Image is up to date for python:3.6-alpine
---> 1837080c5e87
Step 2/7 : ENV PYTHONUNBUFFERED=1
---> Using cache
---> c4a790b9c973
Step 3/7 : WORKDIR /app
---> Using cache
---> 69ff1c48b2ac
Step 4/7 : COPY requirements.txt requirements.txt
--> Steps passed: 5.60s
--> Pipeline finished: 5.80s


It cannot copy my requirements.txt that is in the same folder as my Dockerfile.



My wercker version:



wercker version 1.0.1216 (Compiled at: 2018-05-01T13:14:48Z, Git commit: 426a99095ec0c95391620319833338afd1ccbc74)



What I am I missing? How can I make the context property work with internal/docker-build?



Edit:
I also tried running the build without the dockerfile property, like so:



    - internal/docker-build:
context: flask-app
image-name: flask-app


In this case, the output:



--> No Docker host specified, checking: /var/run/docker.sock
--> Executing pipeline
--> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
--> Copied working directory: 0.00s
--> Running step: setup environment
Pulling from library/python: 2.7-slim
Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
Status: Image is up to date for python:2.7-slim
--> Copying source to container
--> Running step: wercker-init
--> Running step: docker build
ERROR Failed to build image: Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
--> Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
--> Step failed: docker build Error response from daemon: Cannot locate specified Dockerfile: Dockerfile 0.28s
--> Pipeline failed: 3.40s
FATAL Step failed: docker build


And I have also tried specifying only the dockerfile property, like:



  steps:
- internal/docker-build:
dockerfile: flask-app/Dockerfile
image-name: flask-app


In this case my console output is the same as in the first case.










share|improve this question





























    0















    I have a project, where I intend to build and publish more than one Docker images with wercker. The source code for each of these are in their separate folders inside the project.



    To serve as a simpler example I have created a repository, where you can reproduce this problem. I used an wercker's internal/docker-build. In the link it is clear there is a context property context, but it doesn't seem to have an effect: the context still seems to be the root of my project.



    My folder structure:




    • Root:


      • flask-app


        • app.py

        • requirements.txt

        • Dockerfile



      • wercker.yml




    My wercker.yml file:



    box:
    id: python:2.7-slim
    ports:
    - "5000"

    build:
    steps:
    - internal/docker-build:
    dockerfile: flask-app/Dockerfile
    context: flask-app
    image-name: flask-app


    When I run wercker build --pipeline build in the project root, the output:



    --> No Docker host specified, checking: /var/run/docker.sock
    --> Executing pipeline
    --> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
    --> Copied working directory: 0.00s
    --> Running step: setup environment
    Pulling from library/python: 2.7-slim
    Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
    Status: Image is up to date for python:2.7-slim
    --> Copying source to container
    --> Running step: wercker-init
    --> Running step: docker build
    Step 1/7 : FROM python:3.6-alpine
    Pulling from library/python: 3.6-alpine
    Digest: sha256:4ae5142f052c4efd0bede8483f8ca43a73e8fcfce5dbf8f581967c2c9bac597b
    Status: Image is up to date for python:3.6-alpine
    ---> 1837080c5e87
    Step 2/7 : ENV PYTHONUNBUFFERED=1
    ---> Using cache
    ---> c4a790b9c973
    Step 3/7 : WORKDIR /app
    ---> Using cache
    ---> 69ff1c48b2ac
    Step 4/7 : COPY requirements.txt requirements.txt
    --> Steps passed: 5.60s
    --> Pipeline finished: 5.80s


    It cannot copy my requirements.txt that is in the same folder as my Dockerfile.



    My wercker version:



    wercker version 1.0.1216 (Compiled at: 2018-05-01T13:14:48Z, Git commit: 426a99095ec0c95391620319833338afd1ccbc74)



    What I am I missing? How can I make the context property work with internal/docker-build?



    Edit:
    I also tried running the build without the dockerfile property, like so:



        - internal/docker-build:
    context: flask-app
    image-name: flask-app


    In this case, the output:



    --> No Docker host specified, checking: /var/run/docker.sock
    --> Executing pipeline
    --> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
    --> Copied working directory: 0.00s
    --> Running step: setup environment
    Pulling from library/python: 2.7-slim
    Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
    Status: Image is up to date for python:2.7-slim
    --> Copying source to container
    --> Running step: wercker-init
    --> Running step: docker build
    ERROR Failed to build image: Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
    --> Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
    --> Step failed: docker build Error response from daemon: Cannot locate specified Dockerfile: Dockerfile 0.28s
    --> Pipeline failed: 3.40s
    FATAL Step failed: docker build


    And I have also tried specifying only the dockerfile property, like:



      steps:
    - internal/docker-build:
    dockerfile: flask-app/Dockerfile
    image-name: flask-app


    In this case my console output is the same as in the first case.










    share|improve this question



























      0












      0








      0








      I have a project, where I intend to build and publish more than one Docker images with wercker. The source code for each of these are in their separate folders inside the project.



      To serve as a simpler example I have created a repository, where you can reproduce this problem. I used an wercker's internal/docker-build. In the link it is clear there is a context property context, but it doesn't seem to have an effect: the context still seems to be the root of my project.



      My folder structure:




      • Root:


        • flask-app


          • app.py

          • requirements.txt

          • Dockerfile



        • wercker.yml




      My wercker.yml file:



      box:
      id: python:2.7-slim
      ports:
      - "5000"

      build:
      steps:
      - internal/docker-build:
      dockerfile: flask-app/Dockerfile
      context: flask-app
      image-name: flask-app


      When I run wercker build --pipeline build in the project root, the output:



      --> No Docker host specified, checking: /var/run/docker.sock
      --> Executing pipeline
      --> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
      --> Copied working directory: 0.00s
      --> Running step: setup environment
      Pulling from library/python: 2.7-slim
      Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
      Status: Image is up to date for python:2.7-slim
      --> Copying source to container
      --> Running step: wercker-init
      --> Running step: docker build
      Step 1/7 : FROM python:3.6-alpine
      Pulling from library/python: 3.6-alpine
      Digest: sha256:4ae5142f052c4efd0bede8483f8ca43a73e8fcfce5dbf8f581967c2c9bac597b
      Status: Image is up to date for python:3.6-alpine
      ---> 1837080c5e87
      Step 2/7 : ENV PYTHONUNBUFFERED=1
      ---> Using cache
      ---> c4a790b9c973
      Step 3/7 : WORKDIR /app
      ---> Using cache
      ---> 69ff1c48b2ac
      Step 4/7 : COPY requirements.txt requirements.txt
      --> Steps passed: 5.60s
      --> Pipeline finished: 5.80s


      It cannot copy my requirements.txt that is in the same folder as my Dockerfile.



      My wercker version:



      wercker version 1.0.1216 (Compiled at: 2018-05-01T13:14:48Z, Git commit: 426a99095ec0c95391620319833338afd1ccbc74)



      What I am I missing? How can I make the context property work with internal/docker-build?



      Edit:
      I also tried running the build without the dockerfile property, like so:



          - internal/docker-build:
      context: flask-app
      image-name: flask-app


      In this case, the output:



      --> No Docker host specified, checking: /var/run/docker.sock
      --> Executing pipeline
      --> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
      --> Copied working directory: 0.00s
      --> Running step: setup environment
      Pulling from library/python: 2.7-slim
      Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
      Status: Image is up to date for python:2.7-slim
      --> Copying source to container
      --> Running step: wercker-init
      --> Running step: docker build
      ERROR Failed to build image: Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
      --> Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
      --> Step failed: docker build Error response from daemon: Cannot locate specified Dockerfile: Dockerfile 0.28s
      --> Pipeline failed: 3.40s
      FATAL Step failed: docker build


      And I have also tried specifying only the dockerfile property, like:



        steps:
      - internal/docker-build:
      dockerfile: flask-app/Dockerfile
      image-name: flask-app


      In this case my console output is the same as in the first case.










      share|improve this question
















      I have a project, where I intend to build and publish more than one Docker images with wercker. The source code for each of these are in their separate folders inside the project.



      To serve as a simpler example I have created a repository, where you can reproduce this problem. I used an wercker's internal/docker-build. In the link it is clear there is a context property context, but it doesn't seem to have an effect: the context still seems to be the root of my project.



      My folder structure:




      • Root:


        • flask-app


          • app.py

          • requirements.txt

          • Dockerfile



        • wercker.yml




      My wercker.yml file:



      box:
      id: python:2.7-slim
      ports:
      - "5000"

      build:
      steps:
      - internal/docker-build:
      dockerfile: flask-app/Dockerfile
      context: flask-app
      image-name: flask-app


      When I run wercker build --pipeline build in the project root, the output:



      --> No Docker host specified, checking: /var/run/docker.sock
      --> Executing pipeline
      --> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
      --> Copied working directory: 0.00s
      --> Running step: setup environment
      Pulling from library/python: 2.7-slim
      Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
      Status: Image is up to date for python:2.7-slim
      --> Copying source to container
      --> Running step: wercker-init
      --> Running step: docker build
      Step 1/7 : FROM python:3.6-alpine
      Pulling from library/python: 3.6-alpine
      Digest: sha256:4ae5142f052c4efd0bede8483f8ca43a73e8fcfce5dbf8f581967c2c9bac597b
      Status: Image is up to date for python:3.6-alpine
      ---> 1837080c5e87
      Step 2/7 : ENV PYTHONUNBUFFERED=1
      ---> Using cache
      ---> c4a790b9c973
      Step 3/7 : WORKDIR /app
      ---> Using cache
      ---> 69ff1c48b2ac
      Step 4/7 : COPY requirements.txt requirements.txt
      --> Steps passed: 5.60s
      --> Pipeline finished: 5.80s


      It cannot copy my requirements.txt that is in the same folder as my Dockerfile.



      My wercker version:



      wercker version 1.0.1216 (Compiled at: 2018-05-01T13:14:48Z, Git commit: 426a99095ec0c95391620319833338afd1ccbc74)



      What I am I missing? How can I make the context property work with internal/docker-build?



      Edit:
      I also tried running the build without the dockerfile property, like so:



          - internal/docker-build:
      context: flask-app
      image-name: flask-app


      In this case, the output:



      --> No Docker host specified, checking: /var/run/docker.sock
      --> Executing pipeline
      --> Copying working directory to: /home/handris/Projects/wercker-context/.wercker/projects/wercker-context
      --> Copied working directory: 0.00s
      --> Running step: setup environment
      Pulling from library/python: 2.7-slim
      Digest: sha256:df3ba9998242864e650d62d158685c3c7af8c4f3ae1545bdc38780473b0b6c55
      Status: Image is up to date for python:2.7-slim
      --> Copying source to container
      --> Running step: wercker-init
      --> Running step: docker build
      ERROR Failed to build image: Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
      --> Error response from daemon: Cannot locate specified Dockerfile: Dockerfile
      --> Step failed: docker build Error response from daemon: Cannot locate specified Dockerfile: Dockerfile 0.28s
      --> Pipeline failed: 3.40s
      FATAL Step failed: docker build


      And I have also tried specifying only the dockerfile property, like:



        steps:
      - internal/docker-build:
      dockerfile: flask-app/Dockerfile
      image-name: flask-app


      In this case my console output is the same as in the first case.







      docker continuous-integration dockerfile wercker






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 18 at 16:30







      handris

















      asked Jan 18 at 16:15









      handrishandris

      47231122




      47231122
























          0






          active

          oldest

          votes











          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%2f54257707%2fwerckers-internal-docker-build-fails-with-context-property%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f54257707%2fwerckers-internal-docker-build-fails-with-context-property%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

          Homophylophilia

          Updating UILabel text programmatically using a function

          Cloud Functions - OpenCV Videocapture Read method fails for larger files from cloud storage