Docker file does not COPY files in subdirectories correctly when pushing to a local Balena device from Windows 10Import a file from a subdirectory?How to copy a folder from remote to local using scp?Copying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryHow to include files outside of Docker's build context?Docker COPY not updating files when rebuilding containerCan't complete npm install when directing Docker to local NPM packagesDocker: Using COPY when the Dockerfile is located in a subdirectoryFile copied to Docker image dissappears

Is the destination of a commercial flight important for the pilot?

How does the UK government determine the size of a mandate?

How do I go from 300 unfinished/half written blog posts, to published posts?

Class Action - which options I have?

Did the DC-9 ever use RATO in revenue service?

Anatomically Correct Strange Women In Ponds Distributing Swords

Why are there no referendums in the US?

Tiptoe or tiphoof? Adjusting words to better fit fantasy races

Fine Tuning of the Universe

Unreliable Magic - Is it worth it?

Lay out the Carpet

Hostile work environment after whistle-blowing on coworker and our boss. What do I do?

Is expanding the research of a group into machine learning as a PhD student risky?

How do I find the solutions of the following equation?

How do scammers retract money, while you can’t?

What Brexit proposals are on the table in the indicative votes on the 27th of March 2019?

What is paid subscription needed for in Mortal Kombat 11?

A particular customize with green line and letters for subfloat

How easy is it to start Magic from scratch?

Why not increase contact surface when reentering the atmosphere?

How did Arya survive the stabbing?

Crossing the line between justified force and brutality

How does buying out courses with grant money work?

Closest Prime Number



Docker file does not COPY files in subdirectories correctly when pushing to a local Balena device from Windows 10


Import a file from a subdirectory?How to copy a folder from remote to local using scp?Copying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryHow to include files outside of Docker's build context?Docker COPY not updating files when rebuilding containerCan't complete npm install when directing Docker to local NPM packagesDocker: Using COPY when the Dockerfile is located in a subdirectoryFile copied to Docker image dissappears













2















I am writing a Typescript app that I want to run on several Raspberry Pis managed and deployed using Balena. My dev computer is running Windows 10. I am fairly new to Balena and Docker.



I am trying to compile my typescript in the Docker file, but the COPY command does not seem to copy files in subdirectories correctly when pushing to a Balena device running in local mode.



I have a very simple file structure as I have just initiated the project:



Dockerfile
start.sh
src/
- index.ts
- tsconfig.json


My Dockerfile looks as follows:



FROM resin/raspberrypi3-node:10.0.0
WORKDIR /usr/src/app
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm i -g typescript
RUN JOBS=MAX npm install --production --unsafe-perm && npm cache verify && rm -rf /tmp/*

COPY . ./
RUN tsc -p src
CMD ["bash", "start.sh"]


When building and pushing the image to the Balena device in local mode I get the following error when the execution of the Dockerfile reaches the 'RUN tsc -p src' command:



[Build] [main] Step 8/11 : RUN tsc -p src
[Build] [main] ---> Running in b843b59050da
[Build] [main] error TS5058: The specified path does not exist: 'src'.
Some services failed to build:
main: The command '/bin/sh -c tsc -p src' returned a non-zero code: 1


Likewise I cannot cd to the subdirectory and just run the tsc command from there:



[Build] [main] Step 8/11 : RUN cd src
[Build] [main] ---> Running in 7620e8a516f3
[Build] [main] /bin/sh: 1: cd: can't cd to src


I inserted a 'RUN ls' command into my Dockerfile before 'RUN tsc -p src' to verify the files are being copied which prints out the following:



[Build] [main] Step 8/11 : RUN ls
[Build] [main] ---> Running in bf8b3c63454e
[Build] [main] CHANGELOG.md
[Build] Dockerfile
[Build] README.md
[Build] node_modules
[Build] package-lock.json
[Build] package.json
[Build] srcindex.ts
[Build] srctsconfig.json
[Build] start.sh
[Build] [main] Removing intermediate container bf8b3c63454e
[Build] [main] ---> 27ed6ea5eb9b
[Build] [main] Step 9/11 : RUN tsc -p src
[Build] [main] ---> Running in 6ac5f86b5637
[Build] [main] error TS5058: The specified path does not exist: 'src'.


At first glance it seems like the subdirectory is copied correctly but - correct me if I am wrong - ls should not be able to list files from subdirectories and it seems like the COPY command has somehow flattened the subdirectory. Honestly I am quit uncertain what happened.



Worth noting: the project compiles the TS just fine when just running 'tsc -p src' from the terminal of my dev computer and the files are copied correctly when pushing the project to a Balene device NOT running in local mode. It is when I push the project to a Balena device running in local mode it fails to copy files correctly.



Is there anything obvious I am missing?










share|improve this question




























    2















    I am writing a Typescript app that I want to run on several Raspberry Pis managed and deployed using Balena. My dev computer is running Windows 10. I am fairly new to Balena and Docker.



    I am trying to compile my typescript in the Docker file, but the COPY command does not seem to copy files in subdirectories correctly when pushing to a Balena device running in local mode.



    I have a very simple file structure as I have just initiated the project:



    Dockerfile
    start.sh
    src/
    - index.ts
    - tsconfig.json


    My Dockerfile looks as follows:



    FROM resin/raspberrypi3-node:10.0.0
    WORKDIR /usr/src/app
    COPY package.json package.json
    COPY package-lock.json package-lock.json
    RUN npm i -g typescript
    RUN JOBS=MAX npm install --production --unsafe-perm && npm cache verify && rm -rf /tmp/*

    COPY . ./
    RUN tsc -p src
    CMD ["bash", "start.sh"]


    When building and pushing the image to the Balena device in local mode I get the following error when the execution of the Dockerfile reaches the 'RUN tsc -p src' command:



    [Build] [main] Step 8/11 : RUN tsc -p src
    [Build] [main] ---> Running in b843b59050da
    [Build] [main] error TS5058: The specified path does not exist: 'src'.
    Some services failed to build:
    main: The command '/bin/sh -c tsc -p src' returned a non-zero code: 1


    Likewise I cannot cd to the subdirectory and just run the tsc command from there:



    [Build] [main] Step 8/11 : RUN cd src
    [Build] [main] ---> Running in 7620e8a516f3
    [Build] [main] /bin/sh: 1: cd: can't cd to src


    I inserted a 'RUN ls' command into my Dockerfile before 'RUN tsc -p src' to verify the files are being copied which prints out the following:



    [Build] [main] Step 8/11 : RUN ls
    [Build] [main] ---> Running in bf8b3c63454e
    [Build] [main] CHANGELOG.md
    [Build] Dockerfile
    [Build] README.md
    [Build] node_modules
    [Build] package-lock.json
    [Build] package.json
    [Build] srcindex.ts
    [Build] srctsconfig.json
    [Build] start.sh
    [Build] [main] Removing intermediate container bf8b3c63454e
    [Build] [main] ---> 27ed6ea5eb9b
    [Build] [main] Step 9/11 : RUN tsc -p src
    [Build] [main] ---> Running in 6ac5f86b5637
    [Build] [main] error TS5058: The specified path does not exist: 'src'.


    At first glance it seems like the subdirectory is copied correctly but - correct me if I am wrong - ls should not be able to list files from subdirectories and it seems like the COPY command has somehow flattened the subdirectory. Honestly I am quit uncertain what happened.



    Worth noting: the project compiles the TS just fine when just running 'tsc -p src' from the terminal of my dev computer and the files are copied correctly when pushing the project to a Balene device NOT running in local mode. It is when I push the project to a Balena device running in local mode it fails to copy files correctly.



    Is there anything obvious I am missing?










    share|improve this question


























      2












      2








      2








      I am writing a Typescript app that I want to run on several Raspberry Pis managed and deployed using Balena. My dev computer is running Windows 10. I am fairly new to Balena and Docker.



      I am trying to compile my typescript in the Docker file, but the COPY command does not seem to copy files in subdirectories correctly when pushing to a Balena device running in local mode.



      I have a very simple file structure as I have just initiated the project:



      Dockerfile
      start.sh
      src/
      - index.ts
      - tsconfig.json


      My Dockerfile looks as follows:



      FROM resin/raspberrypi3-node:10.0.0
      WORKDIR /usr/src/app
      COPY package.json package.json
      COPY package-lock.json package-lock.json
      RUN npm i -g typescript
      RUN JOBS=MAX npm install --production --unsafe-perm && npm cache verify && rm -rf /tmp/*

      COPY . ./
      RUN tsc -p src
      CMD ["bash", "start.sh"]


      When building and pushing the image to the Balena device in local mode I get the following error when the execution of the Dockerfile reaches the 'RUN tsc -p src' command:



      [Build] [main] Step 8/11 : RUN tsc -p src
      [Build] [main] ---> Running in b843b59050da
      [Build] [main] error TS5058: The specified path does not exist: 'src'.
      Some services failed to build:
      main: The command '/bin/sh -c tsc -p src' returned a non-zero code: 1


      Likewise I cannot cd to the subdirectory and just run the tsc command from there:



      [Build] [main] Step 8/11 : RUN cd src
      [Build] [main] ---> Running in 7620e8a516f3
      [Build] [main] /bin/sh: 1: cd: can't cd to src


      I inserted a 'RUN ls' command into my Dockerfile before 'RUN tsc -p src' to verify the files are being copied which prints out the following:



      [Build] [main] Step 8/11 : RUN ls
      [Build] [main] ---> Running in bf8b3c63454e
      [Build] [main] CHANGELOG.md
      [Build] Dockerfile
      [Build] README.md
      [Build] node_modules
      [Build] package-lock.json
      [Build] package.json
      [Build] srcindex.ts
      [Build] srctsconfig.json
      [Build] start.sh
      [Build] [main] Removing intermediate container bf8b3c63454e
      [Build] [main] ---> 27ed6ea5eb9b
      [Build] [main] Step 9/11 : RUN tsc -p src
      [Build] [main] ---> Running in 6ac5f86b5637
      [Build] [main] error TS5058: The specified path does not exist: 'src'.


      At first glance it seems like the subdirectory is copied correctly but - correct me if I am wrong - ls should not be able to list files from subdirectories and it seems like the COPY command has somehow flattened the subdirectory. Honestly I am quit uncertain what happened.



      Worth noting: the project compiles the TS just fine when just running 'tsc -p src' from the terminal of my dev computer and the files are copied correctly when pushing the project to a Balene device NOT running in local mode. It is when I push the project to a Balena device running in local mode it fails to copy files correctly.



      Is there anything obvious I am missing?










      share|improve this question
















      I am writing a Typescript app that I want to run on several Raspberry Pis managed and deployed using Balena. My dev computer is running Windows 10. I am fairly new to Balena and Docker.



      I am trying to compile my typescript in the Docker file, but the COPY command does not seem to copy files in subdirectories correctly when pushing to a Balena device running in local mode.



      I have a very simple file structure as I have just initiated the project:



      Dockerfile
      start.sh
      src/
      - index.ts
      - tsconfig.json


      My Dockerfile looks as follows:



      FROM resin/raspberrypi3-node:10.0.0
      WORKDIR /usr/src/app
      COPY package.json package.json
      COPY package-lock.json package-lock.json
      RUN npm i -g typescript
      RUN JOBS=MAX npm install --production --unsafe-perm && npm cache verify && rm -rf /tmp/*

      COPY . ./
      RUN tsc -p src
      CMD ["bash", "start.sh"]


      When building and pushing the image to the Balena device in local mode I get the following error when the execution of the Dockerfile reaches the 'RUN tsc -p src' command:



      [Build] [main] Step 8/11 : RUN tsc -p src
      [Build] [main] ---> Running in b843b59050da
      [Build] [main] error TS5058: The specified path does not exist: 'src'.
      Some services failed to build:
      main: The command '/bin/sh -c tsc -p src' returned a non-zero code: 1


      Likewise I cannot cd to the subdirectory and just run the tsc command from there:



      [Build] [main] Step 8/11 : RUN cd src
      [Build] [main] ---> Running in 7620e8a516f3
      [Build] [main] /bin/sh: 1: cd: can't cd to src


      I inserted a 'RUN ls' command into my Dockerfile before 'RUN tsc -p src' to verify the files are being copied which prints out the following:



      [Build] [main] Step 8/11 : RUN ls
      [Build] [main] ---> Running in bf8b3c63454e
      [Build] [main] CHANGELOG.md
      [Build] Dockerfile
      [Build] README.md
      [Build] node_modules
      [Build] package-lock.json
      [Build] package.json
      [Build] srcindex.ts
      [Build] srctsconfig.json
      [Build] start.sh
      [Build] [main] Removing intermediate container bf8b3c63454e
      [Build] [main] ---> 27ed6ea5eb9b
      [Build] [main] Step 9/11 : RUN tsc -p src
      [Build] [main] ---> Running in 6ac5f86b5637
      [Build] [main] error TS5058: The specified path does not exist: 'src'.


      At first glance it seems like the subdirectory is copied correctly but - correct me if I am wrong - ls should not be able to list files from subdirectories and it seems like the COPY command has somehow flattened the subdirectory. Honestly I am quit uncertain what happened.



      Worth noting: the project compiles the TS just fine when just running 'tsc -p src' from the terminal of my dev computer and the files are copied correctly when pushing the project to a Balene device NOT running in local mode. It is when I push the project to a Balena device running in local mode it fails to copy files correctly.



      Is there anything obvious I am missing?







      docker copy dockerfile subdirectory






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 11 at 9:52







      Tobias Emil Harbo

















      asked Mar 8 at 11:17









      Tobias Emil HarboTobias Emil Harbo

      113




      113






















          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%2f55062122%2fdocker-file-does-not-copy-files-in-subdirectories-correctly-when-pushing-to-a-lo%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%2f55062122%2fdocker-file-does-not-copy-files-in-subdirectories-correctly-when-pushing-to-a-lo%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

          Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

          Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

          How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page